From 542d21447342e073a0020f93ca26faf196b6aae8 Mon Sep 17 00:00:00 2001 From: genteure Date: Sat, 11 Jun 2022 16:34:47 +0800 Subject: [PATCH] WPF: Update language selector --- .../Controls/WorkDirectorySelectorDialog.xaml | 2 +- .../Controls/WorkDirectorySelectorDialog.xaml.cs | 9 +++++++++ BililiveRecorder.WPF/Pages/RootPage.xaml | 2 +- BililiveRecorder.WPF/Pages/RootPage.xaml.cs | 9 +++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml b/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml index e9661de..dc80417 100644 --- a/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml +++ b/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml @@ -35,7 +35,7 @@ - + diff --git a/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml.cs b/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml.cs index a6136e0..917c80f 100644 --- a/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml.cs +++ b/BililiveRecorder.WPF/Controls/WorkDirectorySelectorDialog.xaml.cs @@ -26,6 +26,15 @@ namespace BililiveRecorder.WPF.Controls { this.DataContext = this; this.InitializeComponent(); + + try + { + new System.Globalization.CultureInfo("en-PN"); + } + catch (System.Exception) + { + this.JokeLangSelectionMenuItem.Visibility = System.Windows.Visibility.Collapsed; + } } public enum WorkDirectorySelectorDialogError diff --git a/BililiveRecorder.WPF/Pages/RootPage.xaml b/BililiveRecorder.WPF/Pages/RootPage.xaml index 8e3b3ee..2a5759c 100644 --- a/BililiveRecorder.WPF/Pages/RootPage.xaml +++ b/BililiveRecorder.WPF/Pages/RootPage.xaml @@ -65,7 +65,7 @@ - + diff --git a/BililiveRecorder.WPF/Pages/RootPage.xaml.cs b/BililiveRecorder.WPF/Pages/RootPage.xaml.cs index 24ad40e..9744800 100644 --- a/BililiveRecorder.WPF/Pages/RootPage.xaml.cs +++ b/BililiveRecorder.WPF/Pages/RootPage.xaml.cs @@ -65,6 +65,15 @@ namespace BililiveRecorder.WPF.Pages this.InitializeComponent(); this.AdvancedSettingsPageItem.Visibility = Visibility.Hidden; + try + { + new System.Globalization.CultureInfo("en-PN"); + } + catch (Exception) + { + this.JokeLangSelectionMenuItem.Visibility = System.Windows.Visibility.Collapsed; + } + #if DEBUG this.DebugBuildIcon.Visibility = Visibility.Visible; #endif