From a74ccc5f0241e5039ba66613496cd904f0b7756e Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 11 Jun 2015 19:33:30 +0000 Subject: WinGui: Moving the bulk of the view model strings to resources. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7292 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrakeWPF/ViewModels/AddPresetViewModel.cs | 10 +- .../ViewModels/AudioDefaultsViewModel.cs | 237 --------------------- win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 5 +- .../HandBrakeWPF/ViewModels/ChaptersViewModel.cs | 5 +- .../ViewModels/CountdownAlertViewModel.cs | 3 +- win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs | 11 +- win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs | 28 +-- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 11 +- .../ViewModels/PictureSettingsViewModel.cs | 3 +- .../ViewModels/QueueSelectionViewModel.cs | 3 +- win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | 50 ++--- win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 2 +- .../ViewModels/StaticPreviewViewModel.cs | 12 +- .../HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 5 +- 14 files changed, 78 insertions(+), 307 deletions(-) delete mode 100644 win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs (limited to 'win/CS/HandBrakeWPF/ViewModels') diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs index 189472949..4a3b42dc5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs @@ -173,13 +173,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.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.AddPresetViewModel_PresetMustProvideName, 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?", Resources.Error, MessageBoxButton.YesNo, MessageBoxImage.Error); + MessageBoxResult result = this.errorService.ShowMessageBox(Resources.AddPresetViewModel_PresetWithSameNameOverwriteWarning, Resources.Error, MessageBoxButton.YesNo, MessageBoxImage.Error); if (result == MessageBoxResult.No) { return; @@ -188,13 +188,13 @@ 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.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.AddPresetViewModel_YouMustFirstScanSource, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } if (this.CustomWidth == null && this.CustomHeight == null && this.SelectedPictureSettingMode == PresetPictureSettingsMode.Custom) { - this.errorService.ShowMessageBox("The Custom Width or Height fields must be filled in for the 'Custom' option.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + this.errorService.ShowMessageBox(Resources.AddPresetViewModel_CustomWidthHeightFieldsRequired, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -226,7 +226,7 @@ namespace HandBrakeWPF.ViewModels bool added = this.presetService.Add(this.Preset); if (!added) { - this.errorService.ShowMessageBox("Unable to add preset", "Unknown Error", MessageBoxButton.OK, + this.errorService.ShowMessageBox(Resources.AddPresetViewModel_UnableToAddPreset, Resources.UnknownError, MessageBoxButton.OK, MessageBoxImage.Error); } else diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs deleted file mode 100644 index 18fee1926..000000000 --- a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs +++ /dev/null @@ -1,237 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The Audio Defaults View Model -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.ViewModels -{ - using System.Collections.Generic; - using System.ComponentModel; - using System.Linq; - - using Caliburn.Micro; - - using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrake.ApplicationServices.Utilities; - - using HandBrakeWPF.Commands; - using HandBrakeWPF.Model.Audio; - using HandBrakeWPF.Services.Interfaces; - using HandBrakeWPF.Services.Presets.Model; - using HandBrakeWPF.ViewModels.Interfaces; - - /// - /// The Audio View Model - /// - public class AudioDefaultsViewModel : ViewModelBase, IAudioDefaultsViewModel - { - /// - /// The available languages. - /// - private BindingList availableLanguages; - - /// - /// The audio behaviours. - /// - private AudioBehaviours audioBehaviours; - - #region Constructors and Destructors - - /// - /// Initializes a new instance of the class. - /// - /// - /// The window manager. - /// - /// - /// The user Setting Service. - /// - public AudioDefaultsViewModel(IWindowManager windowManager, IUserSettingService userSettingService) - { - this.AudioEncoders = EnumHelper.GetEnumList(); - - this.AudioBehaviours = new AudioBehaviours(); - this.SelectedAvailableToMove = new BindingList(); - this.SelectedLangaugesToMove = new BindingList(); - this.AvailableLanguages = new BindingList(); - this.SetupLanguages(null); - } - - #endregion - - #region Properties - - /// - /// Gets or sets the audio behaviours. - /// - public AudioBehaviours AudioBehaviours - { - get - { - return this.audioBehaviours; - } - set - { - if (Equals(value, this.audioBehaviours)) - { - return; - } - this.audioBehaviours = value; - this.NotifyOfPropertyChange(() => this.AudioBehaviours); - } - } - - /// - /// Gets the audio behaviour modes. - /// - public BindingList AudioBehaviourModeList - { - get - { - return new BindingList(EnumHelper.GetEnumList().ToList()); - } - } - - /// - /// Gets or sets AudioEncoders. - /// - public IEnumerable AudioEncoders { get; set; } - - - /// - /// Gets or sets AvailableLanguages. - /// - public BindingList AvailableLanguages - { - get - { - return this.availableLanguages; - } - - set - { - this.availableLanguages = value; - this.NotifyOfPropertyChange("AvailableLanguages"); - } - } - - /// - /// Gets or sets SelectedLangauges. - /// - public BindingList SelectedAvailableToMove { get; set; } - - /// - /// Gets or sets SelectedLangauges. - /// - public BindingList SelectedLangaugesToMove { get; set; } - - #endregion - - #region Public Methods - - /// - /// Audio List Move Left - /// - public void LanguageMoveRight() - { - if (this.SelectedAvailableToMove.Count > 0) - { - List copiedList = SelectedAvailableToMove.ToList(); - foreach (string item in copiedList) - { - this.AvailableLanguages.Remove(item); - this.AudioBehaviours.SelectedLangauges.Add(item); - } - - this.AvailableLanguages = new BindingList(this.AvailableLanguages.OrderBy(o => o).ToList()); - } - } - - /// - /// Audio List Move Right - /// - public void LanguageMoveLeft() - { - if (this.SelectedLangaugesToMove.Count > 0) - { - List copiedList = SelectedLangaugesToMove.ToList(); - foreach (string item in copiedList) - { - this.AudioBehaviours.SelectedLangauges.Remove(item); - this.AvailableLanguages.Add(item); - } - } - - this.AvailableLanguages = new BindingList(this.AvailableLanguages.OrderBy(o => o).ToList()); - } - - /// - /// Audio List Clear all selected languages - /// - public void LanguageClearAll() - { - foreach (string item in this.AudioBehaviours.SelectedLangauges) - { - this.AvailableLanguages.Add(item); - } - this.AvailableLanguages = new BindingList(this.AvailableLanguages.OrderBy(o => o).ToList()); - - this.AudioBehaviours.SelectedLangauges.Clear(); - } - - /// - /// The close. - /// - public void Close() - { - CloseOverlayPanelCommand command = new CloseOverlayPanelCommand(); - command.Execute(null); - } - - #endregion - - #region Methods - - /// - /// The setup languages. - /// - /// - /// The preset. - /// - private void SetupLanguages(Preset preset) - { - // Step 1, Set the behaviour mode - this.AudioBehaviours.SelectedBehaviour = AudioBehaviourModes.None; - this.AudioBehaviours.SelectedLangauges.Clear(); - - // Step 2, Get all the languages - IDictionary langList = LanguageUtilities.MapLanguages(); - langList = (from entry in langList orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); - - // Step 3, Setup Available Languages - this.AvailableLanguages.Clear(); - foreach (string item in langList.Keys) - { - this.AvailableLanguages.Add(item); - } - - // Step 4, Set the Selected Languages - if (preset != null && preset.AudioTrackBehaviours != null) - { - this.AudioBehaviours.SelectedBehaviour = preset.AudioTrackBehaviours.SelectedBehaviour; - - foreach (string selectedItem in preset.AudioTrackBehaviours.SelectedLangauges) - { - this.AvailableLanguages.Remove(selectedItem); - this.AudioBehaviours.SelectedLangauges.Add(selectedItem); - } - } - } - - #endregion - } -} \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 3424b4c09..75adf94be 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -23,6 +23,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Utilities; using HandBrakeWPF.Model.Audio; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.ViewModels.Interfaces; @@ -199,7 +200,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.ShowAudioDefaultsPanel ? "Audio Defaults" : "Audio Tracks"; + return this.ShowAudioDefaultsPanel ? Resources.AudioViewModel_AudioDefaults : Resources.AudioViewModel_AudioTracks; } } @@ -210,7 +211,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.ShowAudioDefaultsPanel ? "Switch Back To Tracks" : "Configure Defaults"; + return this.ShowAudioDefaultsPanel ? Resources.AudioViewModel_SwitchBackToTracks : Resources.AudioViewModel_ConfigureDefaults; } } diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs index 881d3db6e..cca7b2334 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs @@ -21,6 +21,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Encode.Model.Models; using HandBrake.ApplicationServices.Services.Scan.Model; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.ViewModels.Interfaces; @@ -140,8 +141,8 @@ namespace HandBrakeWPF.ViewModels catch (Exception exc) { throw new GeneralApplicationException( - "Unable to save Chapter Makrers file! ", - "Chapter marker names will NOT be saved in your encode.", + Resources.ChaptersViewModel_UnableToExportChaptersWarning, + Resources.ChaptersViewModel_UnableToExportChaptersMsg, exc); } } diff --git a/win/CS/HandBrakeWPF/ViewModels/CountdownAlertViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/CountdownAlertViewModel.cs index 0f92c18b8..703f9a5af 100644 --- a/win/CS/HandBrakeWPF/ViewModels/CountdownAlertViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/CountdownAlertViewModel.cs @@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels using System; using System.Windows.Threading; + using HandBrakeWPF.Properties; using HandBrakeWPF.ViewModels.Interfaces; /// @@ -73,7 +74,7 @@ namespace HandBrakeWPF.ViewModels { get { - return string.Format("The following action '{0}' will occur in {1} seconds.", action, CountdownTime - this.Ticks); + return string.Format(Resources.CountdownAlertViewModel_NoticeMessage, action, CountdownTime - this.Ticks); } } diff --git a/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs index 78e4867ea..be57cd804 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs @@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels using System; using System.Windows; + using HandBrakeWPF.Properties; using HandBrakeWPF.ViewModels.Interfaces; /// @@ -45,9 +46,9 @@ namespace HandBrakeWPF.ViewModels /// public ErrorViewModel() { - this.Title = "Error"; - this.ErrorMessage = "An Unknown Error has occured."; - this.Details = "There is no further information available about this error."; + this.Title = Resources.Error; + this.ErrorMessage = Resources.ErrorViewModel_UnknownError; + this.Details = Resources.ErrorViewModel_NoFurtherInformation; } #endregion @@ -61,7 +62,7 @@ namespace HandBrakeWPF.ViewModels { get { - return string.IsNullOrEmpty(this.details) ? "There is no further information available about this error." : this.details; + return string.IsNullOrEmpty(this.details) ? Resources.ErrorViewModel_NoFurtherInformation : this.details; } set @@ -95,7 +96,7 @@ namespace HandBrakeWPF.ViewModels { get { - return string.IsNullOrEmpty(this.solution) ? "If the problem presists, please try restarting HandBrake." : this.solution; + return string.IsNullOrEmpty(this.solution) ? Resources.ErrorViewModel_IfTheProblemPersists : this.solution; } set diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs index d369728a7..99ab912a6 100644 --- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs @@ -129,13 +129,13 @@ namespace HandBrakeWPF.ViewModels protected override void OnActivate() { this.scanService.ScanCompleted += ScanServiceScanCompleted; - this.encodeService.EncodeCompleted += EncodeServiceEncodeCompleted; - this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged; - this.scanService.ScanStatusChanged += this.ScanServiceScanStatusChanged; - this.scanService.ScanStarted += this.scanService_ScanStared; - this.encodeService.EncodeStarted += this.encodeService_EncodeStarted; - base.OnActivate(); - + this.encodeService.EncodeCompleted += EncodeServiceEncodeCompleted; + this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged; + this.scanService.ScanStatusChanged += this.ScanServiceScanStatusChanged; + this.scanService.ScanStarted += this.scanService_ScanStared; + this.encodeService.EncodeStarted += this.encodeService_EncodeStarted; + base.OnActivate(); + this.NotifyOfPropertyChange(() => this.ScanLog); this.NotifyOfPropertyChange(() => this.EncodeLog); } @@ -182,13 +182,13 @@ namespace HandBrakeWPF.ViewModels protected override void OnDeactivate(bool close) { this.scanService.ScanCompleted -= ScanServiceScanCompleted; - this.encodeService.EncodeCompleted -= EncodeServiceEncodeCompleted; - this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged; - this.scanService.ScanStatusChanged -= this.ScanServiceScanStatusChanged; - this.scanService.ScanStarted -= this.scanService_ScanStared; - this.encodeService.EncodeStarted -= this.encodeService_EncodeStarted; - - base.OnDeactivate(close); + this.encodeService.EncodeCompleted -= EncodeServiceEncodeCompleted; + this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged; + this.scanService.ScanStatusChanged -= this.ScanServiceScanStatusChanged; + this.scanService.ScanStarted -= this.scanService_ScanStared; + this.encodeService.EncodeStarted -= this.encodeService_EncodeStarted; + + base.OnDeactivate(close); } /// diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index be12f2010..b233dc449 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -23,6 +23,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Utilities; using HandBrakeWPF.Model; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; @@ -1528,17 +1529,17 @@ namespace HandBrakeWPF.ViewModels this.updateInfo = info; if (info.NewVersionAvailable) { - this.UpdateMessage = "A New Update is Available!"; + this.UpdateMessage = Resources.OptionsViewModel_NewUpdate; this.UpdateAvailable = true; } else if (Environment.Is64BitOperatingSystem && !System.Environment.Is64BitProcess) { - this.UpdateMessage = "Your system supports the 64bit version of HandBrake! This offers performance and stability improvements over this 32bit version."; + this.UpdateMessage = Resources.OptionsViewModel_64bitAvailable; this.UpdateAvailable = true; } else { - this.UpdateMessage = "There are no new updates at this time."; + this.UpdateMessage = Resources.OptionsViewModel_NoNewUpdates; this.UpdateAvailable = false; } } @@ -1554,7 +1555,7 @@ namespace HandBrakeWPF.ViewModels if (info.TotalBytes == 0 || info.BytesRead == 0) { this.UpdateAvailable = false; - this.UpdateMessage = info.WasSuccessful ? "Update Downloaded" : "Update Service Unavailable. You can try downloading the update from https://handbrake.fr"; + this.UpdateMessage = info.WasSuccessful ? Resources.OptionsViewModel_UpdateDownloaded : Resources.OptionsViewModel_UpdateServiceUnavailable; return; } @@ -1575,7 +1576,7 @@ namespace HandBrakeWPF.ViewModels private void DownloadComplete(DownloadStatus info) { this.UpdateAvailable = false; - this.UpdateMessage = info.WasSuccessful ? "Update Downloaded" : "Update Failed. You can try downloading the update from https://handbrake.fr"; + this.UpdateMessage = info.WasSuccessful ? Resources.OptionsViewModel_UpdateDownloaded : Resources.OptionsViewModel_UpdateFailed; Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe")); Execute.OnUIThread(() => Application.Current.Shutdown()); diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 1dd0ad93c..90fd2b3ff 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -19,6 +19,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Interop.Model.Encoding; using HandBrakeWPF.Helpers; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.Utilities; using HandBrakeWPF.ViewModels.Interfaces; @@ -932,7 +933,7 @@ namespace HandBrakeWPF.ViewModels double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0); this.DisplaySize = this.sourceResolution == null || this.sourceResolution.IsEmpty ? string.Empty - : string.Format("Storage: {0}x{1}, Display: {2}x{3}", result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight); + : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight); // Step 4, Force an update on all the UI elements. this.NotifyOfPropertyChange(() => this.Width); diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs index c175056a4..0c99ceeae 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueSelectionViewModel.cs @@ -17,6 +17,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Scan.Model; using HandBrakeWPF.Model; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.ViewModels.Interfaces; @@ -54,7 +55,7 @@ namespace HandBrakeWPF.ViewModels public QueueSelectionViewModel(IErrorService errorService) { this.errorService = errorService; - this.Title = "Add to Queue"; + this.Title = Resources.QueueSelectionViewModel_AddToQueue; this.TitleList = new BindingList(); this.OrderedByTitle = true; } diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index a5d33aa42..305b1c466 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -93,9 +93,9 @@ namespace HandBrakeWPF.ViewModels this.userSettingService = userSettingService; this.queueProcessor = queueProcessor; this.errorService = errorService; - this.Title = "Queue"; - this.JobsPending = "No encodes pending"; - this.JobStatus = "There are no jobs currently encoding"; + this.Title = Resources.QueueViewModel_Queue; + this.JobsPending = Resources.QueueViewModel_NoEncodesPending; + this.JobStatus = Resources.QueueViewModel_NoJobsPending; this.SelectedItems = new BindingList(); } @@ -208,7 +208,7 @@ namespace HandBrakeWPF.ViewModels public void Clear() { MessageBoxResult result = this.errorService.ShowMessageBox( - "Are you sure you wish to clear the queue?", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Warning); + Resources.QueueViewModel_ClearQueueConfrimation, Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result == MessageBoxResult.Yes) { this.queueProcessor.Clear(); @@ -238,7 +238,7 @@ namespace HandBrakeWPF.ViewModels { // Setup the window to the correct state. this.IsEncoding = this.queueProcessor.EncodeService.IsEncoding; - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); base.OnLoad(); } @@ -250,11 +250,11 @@ namespace HandBrakeWPF.ViewModels { this.queueProcessor.Pause(); - this.JobStatus = "Queue Paused"; - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobStatus = Resources.QueueViewModel_QueuePending; + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); this.IsEncoding = false; - MessageBox.Show("The Queue has been paused. The currently running job will run to completion and no further jobs will start.", "Queue", + MessageBox.Show(Resources.QueueViewModel_QueuePauseNotice, Resources.QueueViewModel_Queue, MessageBoxButton.OK, MessageBoxImage.Information); } @@ -265,7 +265,7 @@ namespace HandBrakeWPF.ViewModels { MessageBoxResult result = this.errorService.ShowMessageBox( - "Are you sure you want to delete the selected jobs?", + Resources.QueueViewModel_DelSelectedJobConfirmation, Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question); @@ -300,7 +300,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?", + Resources.QueueViewModel_JobCurrentlyRunningWarning, Resources.Warning, MessageBoxButton.YesNo, MessageBoxImage.Question); @@ -327,7 +327,7 @@ namespace HandBrakeWPF.ViewModels { task.Status = QueueItemStatus.Waiting; this.queueProcessor.BackupQueue(null); - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); } /// @@ -338,12 +338,12 @@ namespace HandBrakeWPF.ViewModels if (this.queueProcessor.Count == 0) { this.errorService.ShowMessageBox( - "There are no pending jobs.", Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + Resources.QueueViewModel_NoPendingJobs, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } - this.JobStatus = "Queue Started"; - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobStatus = Resources.QueueViewModel_QueueStarted; + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); this.IsEncoding = true; this.queueProcessor.Start(UserSettingService.GetUserSetting(UserSettingConstants.ClearCompletedFromQueue)); @@ -388,7 +388,7 @@ namespace HandBrakeWPF.ViewModels public void EditJob(QueueTask task) { MessageBoxResult result = this.errorService.ShowMessageBox( - "Are you sure you wish to edit this job? It will be removed from the queue and sent to the main window.", + Resources.QueueViewModel_EditConfrimation, "Modify Job?", MessageBoxButton.YesNo, MessageBoxImage.Question); @@ -425,8 +425,8 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor.EncodeService.EncodeCompleted += EncodeService_EncodeCompleted; this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted; - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); - this.JobStatus = "Queue Ready"; + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); + this.JobStatus = Resources.QueueViewModel_QueueReady; base.OnActivate(); } @@ -463,7 +463,7 @@ namespace HandBrakeWPF.ViewModels { this.JobStatus = string.Format( - "Encoding: Pass {0} of {1}, {2:00.00}%, FPS: {3:000.0}, Avg FPS: {4:000.0}, Time Remaining: {5}, Elapsed: {6:hh\\:mm\\:ss}", + Resources.QueueViewModel_QueueStatusDisplay, e.Task, e.TaskCount, e.PercentComplete, @@ -485,11 +485,11 @@ namespace HandBrakeWPF.ViewModels /// private void QueueManager_QueueChanged(object sender, EventArgs e) { - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); if (!queueProcessor.IsProcessing) { - this.JobStatus = "Queue Not Running"; + this.JobStatus = Resources.QueueViewModel_QueueNotRunning; } } @@ -504,8 +504,8 @@ namespace HandBrakeWPF.ViewModels /// private void queueProcessor_QueueCompleted(object sender, EventArgs e) { - this.JobStatus = "Queue Completed"; - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobStatus = Resources.QueueViewModel_QueueCompleted; + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); this.IsEncoding = false; } @@ -522,7 +522,7 @@ namespace HandBrakeWPF.ViewModels { if (!this.queueProcessor.IsProcessing) { - this.JobStatus = "Last Queued Job Finished"; + this.JobStatus = Resources.QueueViewModel_LastJobFinished; } } @@ -537,8 +537,8 @@ namespace HandBrakeWPF.ViewModels /// private void QueueProcessorJobProcessingStarted(object sender, QueueProgressEventArgs e) { - this.JobStatus = "Queue Started"; - this.JobsPending = string.Format("{0} jobs pending", this.queueProcessor.Count); + this.JobStatus = Resources.QueueViewModel_QueueStarted; + this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count); this.IsEncoding = true; } diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs index 11a9d8715..f21345f97 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -236,7 +236,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 exit HandBrake?", + Resources.ShellViewModel_CanClose, Resources.Warning, MessageBoxButton.YesNo, MessageBoxImage.Warning); diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index 768c127d6..6aa7a3050 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -411,7 +411,7 @@ namespace HandBrakeWPF.ViewModels { this.Task = task; this.UpdatePreviewFrame(); - this.DisplayName = "Picture Preview"; + this.DisplayName = Resources.StaticPreviewViewModel_Title; this.Title = Resources.Preview; this.ScannedSource = scannedSource; } @@ -517,13 +517,13 @@ namespace HandBrakeWPF.ViewModels catch (Exception) { this.IsEncoding = false; - this.errorService.ShowMessageBox("Unable to delete previous preview file. You may need to restart the application.", + this.errorService.ShowMessageBox(Resources.StaticPreview_UnableToDeletePreview, 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 preview.", + this.errorService.ShowMessageBox(Resources.StaticPreviewViewModel_ScanFirst, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -604,7 +604,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\")", + this.errorService.ShowMessageBox(Resources.StaticPreviewViewModel_UnableToFindVLC, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } } @@ -618,7 +618,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.", + this.errorService.ShowMessageBox(Resources.StaticPreviewViewModel_UnableToPlayFile, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning); } } @@ -635,7 +635,7 @@ namespace HandBrakeWPF.ViewModels // Make sure we are not already encoding and if we are then display an error. if (encodeService.IsEncoding) { - this.errorService.ShowMessageBox("Handbrake is already encoding a video! Only one file can be encoded at any one time.", + this.errorService.ShowMessageBox(Resources.StaticPreviewViewModel_AlreadyEncoding, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index 14c6a9899..751619c97 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -20,6 +20,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Utilities; using HandBrakeWPF.Model.Subtitles; + using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.ViewModels.Interfaces; @@ -146,7 +147,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.ShowDefaultsPanel ? "Subtitle Defaults" : "Subtitle Tracks"; + return this.ShowDefaultsPanel ? Resources.SubtitlesViewModel_SubDefaults : Resources.SubtitlesViewModel_SubTracks; } } @@ -157,7 +158,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.ShowDefaultsPanel ? "Switch Back To Tracks" : "Configure Defaults"; + return this.ShowDefaultsPanel ? Resources.SubtitlesViewModel_SwitchToTracks : Resources.SubtitlesViewModel_ConfigureDefaults; } } -- cgit v1.2.3