From a5f0eb5c91888caf44125f5f193756256df4e8bf Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 5 Oct 2019 20:03:57 +0100 Subject: WinGui: Make a number of UI compoents translatable. #2345 --- win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs | 2 +- win/CS/HandBrakeWPF/Controls/SourceSelection.xaml | 4 +- .../HandBrakeWPF/Properties/Resources.Designer.cs | 99 ++++++++++++++++++++-- win/CS/HandBrakeWPF/Properties/Resources.resx | 29 ++++++- win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs | 13 +++ win/CS/HandBrakeWPF/Views/MainView.xaml | 8 +- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 12 +-- win/CS/HandBrakeWPF/Views/SummaryView.xaml | 8 +- win/CS/HandBrakeWPF/Views/VideoView.xaml | 2 +- 11 files changed, 151 insertions(+), 30 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs index 477e79c37..938f4b40b 100644 --- a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs +++ b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs @@ -108,7 +108,7 @@ namespace HandBrakeWPF.Controls /// public NumberBox() { - this.noneCaption = "(none)"; + this.noneCaption = string.Empty; this.UpdateBindingOnTextChange = true; this.ShowIncrementButtons = true; this.SelectAllOnClick = true; diff --git a/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml b/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml index 1a5934c94..7069fde07 100644 --- a/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml +++ b/win/CS/HandBrakeWPF/Controls/SourceSelection.xaml @@ -6,7 +6,7 @@ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" xmlns:converters="clr-namespace:HandBrakeWPF.Converters" x:Name="sourcePanel" - > + > @@ -116,7 +116,7 @@ - + diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 915eb3eb4..8e4931c68 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -1204,6 +1204,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Log Viewer. + /// + public static string LogViewModel_Title { + get { + return ResourceManager.GetString("LogViewModel_Title", resourceCulture); + } + } + /// /// Looks up a localized string similar to HandBrake is already encoding.. /// @@ -1745,6 +1754,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Aspect:. + /// + public static string MainView_Aspect { + get { + return ResourceManager.GetString("MainView_Aspect", resourceCulture); + } + } + /// /// Looks up a localized string similar to Audio. /// @@ -1853,6 +1871,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Filters:. + /// + public static string MainView_Filters { + get { + return ResourceManager.GetString("MainView_Filters", resourceCulture); + } + } + /// /// Looks up a localized string similar to Filters. /// @@ -2222,6 +2249,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Size:. + /// + public static string MainView_Size { + get { + return ResourceManager.GetString("MainView_Size", resourceCulture); + } + } + /// /// Looks up a localized string similar to Source:. /// @@ -2348,6 +2384,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Tracks:. + /// + public static string MainView_Tracks { + get { + return ResourceManager.GetString("MainView_Tracks", resourceCulture); + } + } + /// /// Looks up a localized string similar to Update Selected Preset. /// @@ -3183,6 +3228,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to General. + /// + public static string OptionsTab_General { + get { + return ResourceManager.GetString("OptionsTab_General", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to < Back. + /// + public static string OptionsView_BackButton { + get { + return ResourceManager.GetString("OptionsView_BackButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Checking for Updates .... /// @@ -3430,6 +3493,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Click 'Check for Updates' to check for new versions. + /// + public static string OptionsViewModel_CheckForUpdatesMsg { + get { + return ResourceManager.GetString("OptionsViewModel_CheckForUpdatesMsg", resourceCulture); + } + } + /// /// Looks up a localized string similar to A New Update is Available! Please check the website for release notes.. /// @@ -3713,6 +3785,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Preferences. + /// + public static string Preferences { + get { + return ResourceManager.GetString("Preferences", resourceCulture); + } + } + /// /// Looks up a localized string similar to Custom. /// @@ -4072,6 +4153,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Currently Paused. + /// + public static string QueueView_CurrentlyPaused { + get { + return ResourceManager.GetString("QueueView_CurrentlyPaused", resourceCulture); + } + } + /// /// Looks up a localized string similar to Delete. /// @@ -4749,15 +4839,6 @@ namespace HandBrakeWPF.Properties { } } - /// - /// Looks up a localized string similar to Preferences. - /// - public static string SourceSelection_Preferences { - get { - return ResourceManager.GetString("SourceSelection_Preferences", resourceCulture); - } - } - /// /// Looks up a localized string similar to Recover Queue Files. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 437efe84c..f5d81335b 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -1741,7 +1741,7 @@ Would you like to overwrite it? Help - + Preferences @@ -2048,4 +2048,31 @@ Where supported, any user presets will have been imported. Preview Rotation and Flip + + Log Viewer + + + Aspect: + + + Filters: + + + Size: + + + Tracks: + + + General + + + Click 'Check for Updates' to check for new versions + + + < Back + + + Currently Paused + \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs index d1ed6654d..b37939f36 100644 --- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs @@ -48,7 +48,7 @@ namespace HandBrakeWPF.ViewModels { this.errorService = errorService; this.logService = LogService.GetLogger(); - this.Title = "Log Viewer"; + this.Title = Resources.LogViewModel_Title; } /// diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index df1acb451..c3d407f92 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -141,7 +141,7 @@ namespace HandBrakeWPF.ViewModels this.OnLoad(); this.SelectedTab = OptionsTab.General; - this.UpdateMessage = "Click 'Check for Updates' to check for new versions"; + this.UpdateMessage = Resources.OptionsViewModel_CheckForUpdatesMsg; } #endregion diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs index aaf477e1b..9e070e6e7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs @@ -111,6 +111,7 @@ namespace HandBrakeWPF.ViewModels { return this.currentTitle; } + set { if (Equals(value, this.currentTitle)) return; @@ -133,20 +134,29 @@ namespace HandBrakeWPF.ViewModels #region DisplayProperties public BitmapSource PreviewImage { get; set; } + public bool PreviewNotAvailable { get; set; } + public int MaxWidth { get; set; } + public int MaxHeight { get; set; } public string VideoTrackInfo { get; set; } + public string AudioTrackInfo { get; set; } + public string SubtitleTrackInfo { get; set; } + public string ChapterInfo { get; set; } + public string FiltersInfo { get; set; } public string DimensionInfo { get; set; } + public string AspectInfo { get; set; } public bool IsPreviewInfoVisible { get; set; } + public string PreviewInfo { get; set; } public bool IsPreviousPreviewControlVisible @@ -155,6 +165,7 @@ namespace HandBrakeWPF.ViewModels { return this.isPreviousPreviewControlVisible; } + set { if (value == this.isPreviousPreviewControlVisible) return; @@ -169,6 +180,7 @@ namespace HandBrakeWPF.ViewModels { return this.isNextPreviewControlVisible; } + set { if (value == this.isNextPreviewControlVisible) return; @@ -183,6 +195,7 @@ namespace HandBrakeWPF.ViewModels { return this.showPreview; } + set { if (value == this.showPreview) return; diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index ba4e361ea..14fd7f5b9 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -313,7 +313,7 @@ Source="{Binding Converter={StaticResource themeConverter}, ConverterParameter='Activity2.png'}"/>