From ffb84dc9de2d85776c172f48afebd1c773b322e6 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 4 Jun 2015 20:54:14 +0000 Subject: WinGui: Starting to move UI text string to resources. This will allow us to start looking at localisations on the windows gui. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7276 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 10 + .../HandBrakeWPF/Properties/Resources.Designer.cs | 27 ++ win/CS/HandBrakeWPF/Properties/Resources.resx | 9 + win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 300 +++++++++++++++++++++ win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 7 +- win/CS/HandBrakeWPF/Views/AboutView.xaml | 4 +- win/CS/HandBrakeWPF/Views/AddPresetView.xaml | 20 +- win/CS/HandBrakeWPF/Views/ChaptersView.xaml | 21 +- win/CS/HandBrakeWPF/Views/LogView.xaml | 9 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 65 ++--- 10 files changed, 410 insertions(+), 62 deletions(-) create mode 100644 win/CS/HandBrakeWPF/Properties/ResourcesUI.resx (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 14fe06b41..10bddbeb6 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -159,6 +159,11 @@ + + ResourcesUI.resx + True + True + @@ -354,6 +359,11 @@ True Resources.resx + + PublicResXFileCodeGenerator + ResourcesUI.Designer.cs + Designer + PublicResXFileCodeGenerator Resources.Designer.cs diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index f248ee1e2..1cfcd6914 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -780,6 +780,33 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to You can not delete the default preset. Please set another preset as default first.. + /// + public static string MainViewModel_CanNotDeleteDefaultPreset { + get { + return ResourceManager.GetString("MainViewModel_CanNotDeleteDefaultPreset", 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 MainViewModel_EncodeStatusChanged_StatusLabel { + get { + return ResourceManager.GetString("MainViewModel_EncodeStatusChanged_StatusLabel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the preset: . + /// + public static string MainViewModel_PresetRemove_AreYouSure { + get { + return ResourceManager.GetString("MainViewModel_PresetRemove_AreYouSure", resourceCulture); + } + } + /// /// Looks up a localized string similar to Notice. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index c51a184dd..175695ae1 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -578,4 +578,13 @@ The Activity log may have further information. Start Queue + + You can not delete the default preset. Please set another preset as default first. + + + Are you sure you want to delete the preset: + + + {0:00.00}% FPS: {1:000.0} Avg FPS: {2:000.0} Time Remaining: {3} Elapsed: {4:hh\:mm\:ss} + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx new file mode 100644 index 000000000..b780ecbb5 --- /dev/null +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Activity Log + + + Add + + + Add to Queue + + + Advanced + + + Angle + + + Audio + + + Browse + + + Chapters + + + Container + + + Destination + + + Duration + + + File + + + Filters + + + Help + + + iPod 5G Support + + + Options + + + Output Settings + + + Pause + + + Picture + + + Presets + + + Preview + + + Remove + + + Show Queue + + + Source + + + Start Encode + + + Start Queue + + + Stop + + + Subtitles + + + through + + + Title + + + Tools + + + Video + + + Web Optimized + + + License: + + + Version: + + + Add Preset + + + Description: + + + Name: + + + Save Picture Size: + + + Save Video Filter Settings + + + Cancel + + + Chapter Markers + + + Chapter Name + + + Chapter Number + + + Create chapter markers + + + Duration + + + Export + + + Import + + + Export Names + + + Import Names + + + Reset Chapter Names + + + Export + + + Import + + + Copy to clipboard + + + Encode Log + + + Open Log Directory + + + ScanLog + + + Reset Built-in Presets + + + Set Default + + + Update Selected Preset + + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 327468411..f995b4d2e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -21,7 +21,6 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro; - using HandBrake.ApplicationServices.Model; using HandBrake.ApplicationServices.Services.Encode.EventArgs; using HandBrake.ApplicationServices.Services.Encode.Interfaces; using HandBrake.ApplicationServices.Services.Encode.Model; @@ -1765,7 +1764,7 @@ namespace HandBrakeWPF.ViewModels if (this.selectedPreset.IsDefault) { this.errorService.ShowMessageBox( - "You can not delete the default preset. Please set another preset as default first.", + Resources.MainViewModel_CanNotDeleteDefaultPreset, Resources.Warning, MessageBoxButton.OK, MessageBoxImage.Information); @@ -1775,7 +1774,7 @@ namespace HandBrakeWPF.ViewModels MessageBoxResult result = this.errorService.ShowMessageBox( - "Are you sure you want to delete the preset: " + this.selectedPreset.Name + " ?", + Resources.MainViewModel_PresetRemove_AreYouSure + this.selectedPreset.Name + " ?", Resources.Question, MessageBoxButton.YesNo, MessageBoxImage.Question); @@ -2252,7 +2251,7 @@ namespace HandBrakeWPF.ViewModels if (this.queueProcessor.EncodeService.IsEncoding) { this.ProgramStatusLabel = - string.Format("{0:00.00}% FPS: {1:000.0} Avg FPS: {2:000.0} Time Remaining: {3} Elapsed: {4:hh\\:mm\\:ss}" + Resources.Main_JobsPending_addon, + string.Format(Resources.MainViewModel_EncodeStatusChanged_StatusLabel + Resources.Main_JobsPending_addon, e.PercentComplete, e.CurrentFrameRate, e.AverageFrameRate, diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml b/win/CS/HandBrakeWPF/Views/AboutView.xaml index ac625ef5d..01fc3f2d0 100644 --- a/win/CS/HandBrakeWPF/Views/AboutView.xaml +++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml @@ -34,11 +34,11 @@ - + - + diff --git a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml index 9940282c7..eb9d67b26 100644 --- a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml +++ b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml @@ -33,8 +33,8 @@ - - + + @@ -56,7 +56,7 @@ + Text="{x:Static Properties:ResourcesUI.AddPresetView_Name}" /> - + Text="{x:Static Properties:ResourcesUI.AddPresetView_SavePictureSize}" /> + Text="{x:Static Properties:ResourcesUI.AddPresetView_Description}" /> - + @@ -125,13 +125,13 @@ @@ -41,7 +42,7 @@ - +