From ab24a483dcef737bcc49facd3a406b0364ab4098 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 29 Dec 2013 21:06:41 +0000 Subject: WinGui: Move a bunch of strings out to the resources file. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5946 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrakeWPF/Properties/Resources.Designer.cs | 334 +++++++++++++++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 112 +++++++ .../HandBrakeWPF/ViewModels/AddPresetViewModel.cs | 7 +- win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs | 6 +- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 102 +++---- win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs | 13 +- win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | 5 +- win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 3 +- 8 files changed, 516 insertions(+), 66 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index b3f489a54..51cf2af22 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -337,6 +337,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Are you sure?. + /// + public static string AreYouSure { + get { + return ResourceManager.GetString("AreYouSure", resourceCulture); + } + } + /// /// Looks up a localized string similar to Error. /// @@ -346,6 +355,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to HandBrake. + /// + public static string HandBrake_Title { + get { + return ResourceManager.GetString("HandBrake_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to HandBrake is already encoding.. + /// + public static string Main_AlreadyEncoding { + get { + return ResourceManager.GetString("Main_AlreadyEncoding", resourceCulture); + } + } + /// /// Looks up a localized string similar to Warning: It is not currently possible to use this feature if you require specific subtitle or audio tracks that the automatic selection feature (see options) doesn't support! Tracks are reset with every new source / title selected.. /// @@ -355,6 +382,232 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Please choose a destination for the file.. + /// + public static string Main_ChooseDestination { + get { + return ResourceManager.GetString("Main_ChooseDestination", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current file already exists, do you wish to overwrite it?. + /// + public static string Main_DestinationOverwrite { + get { + return ResourceManager.GetString("Main_DestinationOverwrite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are jobs on the queue with the same destination path. Please choose a different path for this job.. + /// + public static string Main_DuplicateDestinationOnQueue { + get { + return ResourceManager.GetString("Main_DuplicateDestinationOnQueue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}. + /// + public static string Main_EncodeStatusDisplay { + get { + return ResourceManager.GetString("Main_EncodeStatusDisplay", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to , Pending Jobs {5}. + /// + public static string Main_JobsPending_addon { + get { + return ResourceManager.GetString("Main_JobsPending_addon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Default Preset Set: {0}. + /// + public static string Main_NewDefaultPreset { + get { + return ResourceManager.GetString("Main_NewDefaultPreset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A New Update is Available. Goto Tools Menu > Options to Install. + /// + public static string Main_NewUpdate { + get { + return ResourceManager.GetString("Main_NewUpdate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No Preset selected.. + /// + public static string Main_NoPresetSelected { + get { + return ResourceManager.GetString("Main_NoPresetSelected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You can not modify built in presets. Please select one of your own presets.. + /// + public static string Main_NoUpdateOfBuiltInPresets { + get { + return ResourceManager.GetString("Main_NoUpdateOfBuiltInPresets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please select a folder.. + /// + public static string Main_PleaseSelectFolder { + get { + return ResourceManager.GetString("Main_PleaseSelectFolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing to encode .... + /// + public static string Main_PreparingToEncode { + get { + return ResourceManager.GetString("Main_PreparingToEncode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You can not import a preset with the same name as a built-in preset.. + /// + public static string Main_PresetErrorBuiltInName { + get { + return ResourceManager.GetString("Main_PresetErrorBuiltInName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This preset appears to already exist. Would you like to overwrite it?. + /// + public static string Main_PresetOverwriteWarning { + get { + return ResourceManager.GetString("Main_PresetOverwriteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Presets. + /// + public static string Main_Presets { + get { + return ResourceManager.GetString("Main_Presets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you wish to update the selected preset?. + /// + public static string Main_PresetUpdateConfrimation { + get { + return ResourceManager.GetString("Main_PresetUpdateConfrimation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Preset has now been updated with your current settings.. + /// + public static string Main_PresetUpdated { + get { + return ResourceManager.GetString("Main_PresetUpdated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to HandBrake has determined your built-in presets are out of date... These presets will now be updated. + ///Your custom presets have not been updated so you may have to re-create these by deleting and re-adding them.. + /// + public static string Main_PresetUpdateNotification { + get { + return ResourceManager.GetString("Main_PresetUpdateNotification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Queue Finished. + /// + public static string Main_QueueFinished { + get { + return ResourceManager.GetString("Main_QueueFinished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scan Cancelled.. + /// + public static string Main_ScanCancelled { + get { + return ResourceManager.GetString("Main_ScanCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scan Completed. + /// + public static string Main_ScanCompleted { + get { + return ResourceManager.GetString("Main_ScanCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scan failed: . + /// + public static string Main_ScanFailed_NoReason { + get { + return ResourceManager.GetString("Main_ScanFailed_NoReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scan Failed... See Activity Log for details.. + /// + public static string Main_ScanFailled_CheckLog { + get { + return ResourceManager.GetString("Main_ScanFailled_CheckLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scanning source, please wait.... + /// + public static string Main_ScanningPleaseWait { + get { + return ResourceManager.GetString("Main_ScanningPleaseWait", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scanning Title {0} of {1} ({2}%). + /// + public static string Main_ScanningTitleXOfY { + get { + return ResourceManager.GetString("Main_ScanningTitleXOfY", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must first scan a source and setup your job before starting an encode.. + /// + public static string Main_ScanSource { + get { + return ResourceManager.GetString("Main_ScanSource", resourceCulture); + } + } + /// /// Looks up a localized string similar to You must first scan a source and setup your job before adding to the queue.. /// @@ -364,6 +617,33 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Please select a preset.. + /// + public static string Main_SelectPreset { + get { + return ResourceManager.GetString("Main_SelectPreset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please select a preset to update.. + /// + public static string Main_SelectPresetForUpdate { + get { + return ResourceManager.GetString("Main_SelectPresetForUpdate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select 'Source' to continue. + /// + public static string Main_SelectSource { + get { + return ResourceManager.GetString("Main_SelectSource", resourceCulture); + } + } + /// /// Looks up a localized string similar to You must turn on automatic file naming AND set a default path in preferences before you can add to the queue.. /// @@ -373,6 +653,33 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to {0} Encodes Pending. + /// + public static string Main_XEncodesPending { + get { + return ResourceManager.GetString("Main_XEncodesPending", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Notice. + /// + public static string Notice { + get { + return ResourceManager.GetString("Notice", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overwrite?. + /// + public static string Overwrite { + get { + return ResourceManager.GetString("Overwrite", resourceCulture); + } + } + /// /// Looks up a localized string similar to The Built-in presets have been reset.. /// @@ -391,6 +698,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Question. + /// + public static string Question { + get { + return ResourceManager.GetString("Question", resourceCulture); + } + } + /// /// Looks up a localized string similar to WARNING: You do not have automatic file naming turned on. Please enable this in options.. /// @@ -409,6 +725,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Read. + /// + public static string State_Ready { + get { + return ResourceManager.GetString("State_Ready", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated. + /// + public static string Updated { + get { + return ResourceManager.GetString("Updated", resourceCulture); + } + } + /// /// Looks up a localized string similar to Accelerates H.264, MPEG-4, VC1 and WMV3 only. ///This can provide a small to modest improvement on slow hardware.. diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 530bedfd6..4ecd0daa9 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -377,4 +377,116 @@ In order to use the QuickSync encoder, you must: Warning + + Are you sure? + + + HandBrake + + + HandBrake is already encoding. + + + Please choose a destination for the file. + + + The current file already exists, do you wish to overwrite it? + + + There are jobs on the queue with the same destination path. Please choose a different path for this job. + + + {0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss} + + + , Pending Jobs {5} + + + New Default Preset Set: {0} + + + A New Update is Available. Goto Tools Menu > Options to Install + + + No Preset selected. + + + You can not modify built in presets. Please select one of your own presets. + + + Please select a folder. + + + Preparing to encode ... + + + You can not import a preset with the same name as a built-in preset. + + + This preset appears to already exist. Would you like to overwrite it? + + + Presets + + + Are you sure you wish to update the selected preset? + + + The Preset has now been updated with your current settings. + + + HandBrake has determined your built-in presets are out of date... These presets will now be updated. +Your custom presets have not been updated so you may have to re-create these by deleting and re-adding them. + + + Queue Finished + + + Scan Cancelled. + + + Scan Completed + + + Scan failed: + + + Scan Failed... See Activity Log for details. + + + Scanning source, please wait... + + + Scanning Title {0} of {1} ({2}%) + + + You must first scan a source and setup your job before starting an encode. + + + Please select a preset. + + + Please select a preset to update. + + + Select 'Source' to continue + + + {0} Encodes Pending + + + Notice + + + Overwrite? + + + Question + + + Read + + + Updated + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs index 858f9cbda..4235a67dc 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs @@ -19,6 +19,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Utilities; using HandBrake.Interop.Model.Encoding; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; @@ -154,13 +155,13 @@ namespace HandBrakeWPF.ViewModels { if (string.IsNullOrEmpty(this.Preset.Name)) { - this.errorService.ShowMessageBox("A Preset must have a Name. Please fill out the Preset Name field.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox("A Preset must have a Name. Please fill out the Preset Name field.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (this.presetService.CheckIfPresetExists(this.Preset.Name)) { - MessageBoxResult result = this.errorService.ShowMessageBox("A Preset with this name already exists. Would you like to overwrite it?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Error); + MessageBoxResult result = this.errorService.ShowMessageBox("A Preset with this name already exists. Would you like to overwrite it?", Resources.Error, MessageBoxButton.YesNo, MessageBoxImage.Error); if (result == MessageBoxResult.No) { return; @@ -169,7 +170,7 @@ namespace HandBrakeWPF.ViewModels if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.SourceMaximum && this.selectedTitle == null) { - this.errorService.ShowMessageBox("You must first scan a source to use the 'Source Maximum' Option.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox("You must first scan a source to use the 'Source Maximum' Option.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } diff --git a/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs index d27ef6694..dcaf1a7f4 100644 --- a/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/InstantViewModel.cs @@ -717,7 +717,7 @@ namespace HandBrakeWPF.ViewModels { // if (this.queueProcessor.IsProcessing) // { - // this.errorService.ShowMessageBox("HandBrake is already encoding.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + // this.errorService.ShowMessageBox("HandBrake is already encoding.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); // return; // } @@ -731,13 +731,13 @@ namespace HandBrakeWPF.ViewModels //// Otherwise, perform Santiy Checking then add to the queue and start if everything is ok. // if (this.SelectedTitle == null) // { - // this.errorService.ShowMessageBox("You must first scan a source.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + // this.errorService.ShowMessageBox("You must first scan a source.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); // return; // } // if (string.IsNullOrEmpty(this.Destination)) // { - // this.errorService.ShowMessageBox("The Destination field was empty.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + // this.errorService.ShowMessageBox("The Destination field was empty.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); // return; // } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index d15fe931a..5b5b95324 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -227,7 +227,7 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor = IoC.Get(); // Setup Properties - this.WindowTitle = "HandBrake"; + this.WindowTitle = Resources.HandBrake_Title; this.CurrentTask = new EncodeTask(); this.CurrentTask.PropertyChanged += this.CurrentTask_PropertyChanged; this.ScannedSource = new Source(); @@ -313,7 +313,7 @@ namespace HandBrakeWPF.ViewModels { get { - return string.IsNullOrEmpty(this.programStatusLabel) ? "Ready" : this.programStatusLabel; + return string.IsNullOrEmpty(this.programStatusLabel) ? Resources.State_Ready : this.programStatusLabel; } set @@ -334,7 +334,7 @@ namespace HandBrakeWPF.ViewModels { get { - return string.IsNullOrEmpty(this.statusLabel) ? "Ready" : this.statusLabel; + return string.IsNullOrEmpty(this.statusLabel) ? Resources.State_Ready : this.statusLabel; } set @@ -408,7 +408,7 @@ namespace HandBrakeWPF.ViewModels set { this.scannedSource = value; - this.NotifyOfPropertyChange("ScannedSource"); + this.NotifyOfPropertyChange(() => ScannedSource); } } @@ -425,7 +425,7 @@ namespace HandBrakeWPF.ViewModels { get { - return string.IsNullOrEmpty(this.sourceLabel) ? "Select 'Source' to continue" : this.sourceLabel; + return string.IsNullOrEmpty(this.sourceLabel) ? Resources.Main_SelectSource : this.sourceLabel; } set @@ -433,7 +433,7 @@ namespace HandBrakeWPF.ViewModels if (!Equals(this.sourceLabel, value)) { this.sourceLabel = value; - this.NotifyOfPropertyChange("SourceLabel"); + this.NotifyOfPropertyChange(() => SourceLabel); } } } @@ -550,7 +550,7 @@ namespace HandBrakeWPF.ViewModels set { duration = value; - this.NotifyOfPropertyChange("Duration"); + this.NotifyOfPropertyChange(() => Duration); } } @@ -858,7 +858,7 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => SelectedOutputFormat); this.NotifyOfPropertyChange(() => this.CurrentTask.OutputFormat); this.NotifyOfPropertyChange(() => IsMkv); - this.SetExtension(string.Format(".{0}", this.selectedOutputFormat.ToString().Replace("av_", string.Empty).ToLower())); // TODO, tidy up + this.SetExtension(string.Format(".{0}", this.selectedOutputFormat.ToString().ToLower())); this.VideoViewModel.RefreshTask(); this.AudioViewModel.RefreshTask(); @@ -989,9 +989,8 @@ namespace HandBrakeWPF.ViewModels this.presetService.Load(); if (this.presetService.CheckIfPresetsAreOutOfDate()) if (!this.userSettingService.GetUserSetting(UserSettingConstants.PresetNotification)) - this.errorService.ShowMessageBox("HandBrake has determined your built-in presets are out of date... These presets will now be updated." + Environment.NewLine + - "Your custom presets have not been updated so you may have to re-create these by deleting and re-adding them.", - "Preset Update", MessageBoxButton.OK, MessageBoxImage.Information); + this.errorService.ShowMessageBox(Resources.Main_PresetUpdateNotification, + Resources.Notice, MessageBoxButton.OK, MessageBoxImage.Information); // Queue Recovery if (!AppArguments.IsInstantHandBrake) @@ -1132,7 +1131,7 @@ namespace HandBrakeWPF.ViewModels { if (this.ScannedSource == null || string.IsNullOrEmpty(this.ScannedSource.ScanPath) || this.ScannedSource.Titles.Count == 0) { - this.errorService.ShowMessageBox("You must first scan a source and setup your job before adding to the queue.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.Main_ScanSourceFirst, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -1143,12 +1142,12 @@ namespace HandBrakeWPF.ViewModels } else { - this.errorService.ShowMessageBox("There are jobs on the queue with the same destination path. Please choose a different path for this job.", "Error", MessageBoxButton.OK, MessageBoxImage.Warning); + this.errorService.ShowMessageBox(Resources.Main_DuplicateDestinationOnQueue, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } if (!this.IsEncoding) { - this.ProgramStatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.Count); + this.ProgramStatusLabel = string.Format(Resources.Main_XEncodesPending, this.queueProcessor.Count); } } @@ -1188,13 +1187,13 @@ namespace HandBrakeWPF.ViewModels { if (this.ScannedSource == null || this.ScannedSource.Titles == null || this.ScannedSource.Titles.Count == 0) { - this.errorService.ShowMessageBox("You must first scan a source and setup your job before adding to the queue.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.Main_ScanSourceFirst, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (!AutoNameHelper.IsAutonamingEnabled()) { - this.errorService.ShowMessageBox("You must turn on automatic file naming in preferences before you can add to the queue.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.Main_TurnOnAutoFileNaming, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -1225,7 +1224,7 @@ namespace HandBrakeWPF.ViewModels /// public void FolderScan() { - VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true }; + VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = Resources.Main_PleaseSelectFolder, UseDescriptionForTitle = true }; dialog.ShowDialog(); ShowSourceSelection = false; @@ -1261,7 +1260,7 @@ namespace HandBrakeWPF.ViewModels { if (this.queueProcessor.IsProcessing) { - this.errorService.ShowMessageBox("HandBrake is already encoding.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.Main_AlreadyEncoding, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -1275,19 +1274,19 @@ namespace HandBrakeWPF.ViewModels // Otherwise, perform Santiy Checking then add to the queue and start if everything is ok. if (this.SelectedTitle == null) { - this.errorService.ShowMessageBox("You must first scan a source.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.Main_ScanSource, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (string.IsNullOrEmpty(this.Destination)) { - this.errorService.ShowMessageBox("The Destination field was empty.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.Main_ChooseDestination, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (File.Exists(this.Destination)) { - MessageBoxResult result = this.errorService.ShowMessageBox("The current file already exists, do you wish to overwrite it?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question); + MessageBoxResult result = this.errorService.ShowMessageBox(Resources.Main_DestinationOverwrite, Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.No) { return; @@ -1475,7 +1474,7 @@ namespace HandBrakeWPF.ViewModels if (this.SelectedPreset == null) { this.errorService.ShowMessageBox( - "Please select a preset to update.", "No Preset selected", MessageBoxButton.OK, MessageBoxImage.Warning); + Resources.Main_SelectPresetForUpdate, Resources.Main_NoPresetSelected, MessageBoxButton.OK, MessageBoxImage.Warning); return; } @@ -1483,17 +1482,17 @@ namespace HandBrakeWPF.ViewModels if (this.SelectedPreset.IsBuildIn) { this.errorService.ShowMessageBox( - "You can not modify built in presets. Please select one of your own presets.", "No Preset selected", MessageBoxButton.OK, MessageBoxImage.Warning); + Resources.Main_NoUpdateOfBuiltInPresets, Resources.Main_NoPresetSelected, MessageBoxButton.OK, MessageBoxImage.Warning); return; } - if (this.errorService.ShowMessageBox("Are you sure you wish to update the selected preset?", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) + if (this.errorService.ShowMessageBox(Resources.Main_PresetUpdateConfrimation, Resources.AreYouSure, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { this.SelectedPreset.Task = new EncodeTask(this.CurrentTask); this.presetService.Update(this.SelectedPreset); this.errorService.ShowMessageBox( - "The Preset has now been updated with your current settings.", "Preset Updated", MessageBoxButton.OK, MessageBoxImage.Information); + Resources.Main_PresetUpdated, Resources.Updated, MessageBoxButton.OK, MessageBoxImage.Information); } } @@ -1508,7 +1507,7 @@ namespace HandBrakeWPF.ViewModels } else { - MessageBox.Show("Please select a preset.", "Presets", MessageBoxButton.OK, MessageBoxImage.Warning); + MessageBox.Show(Resources.Main_SelectPreset, Resources.Warning, MessageBoxButton.OK, MessageBoxImage.Warning); } } @@ -1520,11 +1519,11 @@ namespace HandBrakeWPF.ViewModels if (this.selectedPreset != null) { this.presetService.SetDefault(this.selectedPreset); - MessageBox.Show(string.Format("New Default Preset Set: {0}", this.selectedPreset.Name), "Presets", MessageBoxButton.OK, MessageBoxImage.Warning); + MessageBox.Show(string.Format(Resources.Main_NewDefaultPreset, this.selectedPreset.Name), Resources.Main_Presets, MessageBoxButton.OK, MessageBoxImage.Information); } else { - MessageBox.Show("Please select a preset.", "Presets", MessageBoxButton.OK, MessageBoxImage.Warning); + MessageBox.Show(Resources.Main_SelectPreset, Resources.Warning, MessageBoxButton.OK, MessageBoxImage.Warning); } } @@ -1547,8 +1546,8 @@ namespace HandBrakeWPF.ViewModels if (!presetService.CanUpdatePreset(preset.Name)) { MessageBox.Show( - "You can not import a preset with the same name as a built-in preset.", - "Error", + Resources.Main_PresetErrorBuiltInName, + Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; @@ -1556,8 +1555,8 @@ namespace HandBrakeWPF.ViewModels MessageBoxResult result = MessageBox.Show( - "This preset appears to already exist. Would you like to overwrite it?", - "Overwrite preset?", + Resources.Main_PresetOverwriteWarning, + Resources.Overwrite, MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result == MessageBoxResult.Yes) @@ -1603,7 +1602,7 @@ namespace HandBrakeWPF.ViewModels } else { - MessageBox.Show("Please select a preset.", "Presets", MessageBoxButton.OK, MessageBoxImage.Warning); + MessageBox.Show(Resources.Main_SelectPreset, Resources.Warning, MessageBoxButton.OK, MessageBoxImage.Warning); } } @@ -1613,7 +1612,7 @@ namespace HandBrakeWPF.ViewModels public void PresetReset() { this.presetService.UpdateBuiltInPresets(); - this.NotifyOfPropertyChange("Presets"); + this.NotifyOfPropertyChange(() => this.Presets); this.SelectedPreset = this.presetService.DefaultPreset; this.errorService.ShowMessageBox(Resources.Presets_ResetComplete, Resources.Presets_ResetHeader, MessageBoxButton.OK, MessageBoxImage.Information); } @@ -1699,7 +1698,7 @@ namespace HandBrakeWPF.ViewModels // Cleanup this.ShowStatusWindow = false; this.SourceLabel = this.SourceName; - this.StatusLabel = "Scan Completed"; + this.StatusLabel = Resources.Main_ScanCompleted; }); } @@ -1804,7 +1803,7 @@ namespace HandBrakeWPF.ViewModels { if (information.NewVersionAvailable) { - this.ProgramStatusLabel = "A New Update is Available. Goto Tools Menu > Options to Install"; + this.ProgramStatusLabel = Resources.Main_NewUpdate; } } @@ -1822,8 +1821,8 @@ namespace HandBrakeWPF.ViewModels /// private void ScanStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.ScanProgressEventArgs e) { - this.SourceLabel = string.Format("Scanning Title {0} of {1} ({2}%)", e.CurrentTitle, e.Titles, e.Percentage); - this.StatusLabel = string.Format("Scanning Title {0} of {1} ({2}%)", e.CurrentTitle, e.Titles, e.Percentage); + this.SourceLabel = string.Format(Resources.Main_ScanningTitleXOfY, e.CurrentTitle, e.Titles, e.Percentage); + this.StatusLabel = string.Format(Resources.Main_ScanningTitleXOfY, e.CurrentTitle, e.Titles, e.Percentage); } /// @@ -1852,21 +1851,22 @@ namespace HandBrakeWPF.ViewModels if (e.Successful) { this.SourceLabel = this.SourceName; - this.StatusLabel = "Scan Completed"; + this.StatusLabel = Resources.Main_ScanCompleted; } else if (e.Cancelled) { - this.SourceLabel = "Scan Cancelled."; - this.StatusLabel = "Scan Cancelled."; + this.SourceLabel = Resources.Main_ScanCancelled; + this.StatusLabel = Resources.Main_ScanCancelled; } else if (e.Exception == null && e.ErrorInformation != null) { - this.SourceLabel = "Scan failed: " + e.ErrorInformation; - this.StatusLabel = "Scan failed: " + e.ErrorInformation; + this.SourceLabel = Resources.Main_ScanFailed_NoReason + e.ErrorInformation; + this.StatusLabel = Resources.Main_ScanFailed_NoReason + e.ErrorInformation; } else { - this.SourceLabel = "Scan Failed... See Activity Log for details."; this.StatusLabel = "Scan Failed... See Activity Log for details."; + this.SourceLabel = Resources.Main_ScanFailled_CheckLog; + this.StatusLabel = Resources.Main_ScanFailled_CheckLog; } }); } @@ -1885,7 +1885,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.StatusLabel = "Scanning source, please wait..."; + this.StatusLabel = Resources.Main_ScanningPleaseWait; this.ShowStatusWindow = true; }); } @@ -1914,12 +1914,12 @@ namespace HandBrakeWPF.ViewModels string josPending = string.Empty; if (!AppArguments.IsInstantHandBrake) { - josPending = ", Pending Jobs {5}"; + josPending = Resources.Main_JobsPending_addon; } this.ProgramStatusLabel = string.Format( - "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}" + josPending, + Resources.Main_EncodeStatusDisplay + josPending, e.PercentComplete, e.CurrentFrameRate, e.AverageFrameRate, @@ -1938,7 +1938,7 @@ namespace HandBrakeWPF.ViewModels } else { - this.ProgramStatusLabel = "Queue Finished"; + this.ProgramStatusLabel = Resources.Main_QueueFinished; this.IsEncoding = false; if (this.windowsSeven.IsWindowsSeven) @@ -1963,7 +1963,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.ProgramStatusLabel = "Preparing to encode ..."; + this.ProgramStatusLabel = Resources.Main_PreparingToEncode; this.IsEncoding = true; }); } @@ -1984,7 +1984,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.ProgramStatusLabel = "Queue Finished"; + this.ProgramStatusLabel = Resources.Main_QueueFinished; this.IsEncoding = false; if (this.windowsSeven.IsWindowsSeven) @@ -2008,7 +2008,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread( () => { - this.ProgramStatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.Count); + this.ProgramStatusLabel = string.Format(Resources.Main_XEncodesPending, this.queueProcessor.Count); }); } diff --git a/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs index 5c0913a37..b398a1b5c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs @@ -23,6 +23,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Interfaces; using HandBrakeWPF.Factories; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; @@ -85,7 +86,7 @@ namespace HandBrakeWPF.ViewModels public PreviewViewModel(IErrorService errorService, IUserSettingService userSettingService) { // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point - this.encodeService = new EncodeServiceWrapper(userSettingService); + this.encodeService = new EncodeServiceWrapper(userSettingService); this.errorService = errorService; this.userSettingService = userSettingService; @@ -262,13 +263,13 @@ namespace HandBrakeWPF.ViewModels { this.IsEncoding = false; this.errorService.ShowMessageBox("Unable to delete previous preview file. You may need to restart the application.", - "Error", MessageBoxButton.OK, MessageBoxImage.Error); + Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); } if (this.Task == null || string.IsNullOrEmpty(Task.Source)) { this.errorService.ShowMessageBox("You must first scan a source and setup your encode before creating a perview.", - "Error", MessageBoxButton.OK, MessageBoxImage.Error); + Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -348,7 +349,7 @@ namespace HandBrakeWPF.ViewModels else { this.errorService.ShowMessageBox("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\")", - "Error", MessageBoxButton.OK, MessageBoxImage.Warning); + Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } } @@ -362,7 +363,7 @@ namespace HandBrakeWPF.ViewModels else { this.errorService.ShowMessageBox("Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", - "Error", MessageBoxButton.OK, MessageBoxImage.Warning); + Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } } } @@ -379,7 +380,7 @@ namespace HandBrakeWPF.ViewModels if (encodeService.IsEncoding) { this.errorService.ShowMessageBox("Handbrake is already encoding a video! Only one file can be encoded at any one time.", - "Error", MessageBoxButton.OK, MessageBoxImage.Error); + Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 3347cfddd..c7ddac82c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -19,6 +19,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Model; using HandBrake.ApplicationServices.Services.Interfaces; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; @@ -259,7 +260,7 @@ namespace HandBrakeWPF.ViewModels MessageBoxResult result = this.errorService.ShowMessageBox( "This encode is currently in progress. If you delete it, the encode will be stopped. Are you sure you wish to proceed?", - "Warning", + Resources.Warning, MessageBoxButton.YesNo, MessageBoxImage.Question); @@ -296,7 +297,7 @@ namespace HandBrakeWPF.ViewModels if (this.queueProcessor.Count == 0) { this.errorService.ShowMessageBox( - "There are no pending jobs.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + "There are no pending jobs.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs index 162898f68..d933a6afb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -16,6 +16,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Interfaces; using HandBrakeWPF.Model; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; @@ -198,7 +199,7 @@ namespace HandBrakeWPF.ViewModels MessageBoxResult result = errorService.ShowMessageBox( "An Encode is currently running. Exiting HandBrake will stop this encode.\nAre you sure you wish to continue?", - "Warning", + Resources.Warning, MessageBoxButton.YesNo, MessageBoxImage.Warning); -- cgit v1.2.3