WPF: Update language selector

This commit is contained in:
genteure 2022-06-11 16:34:47 +08:00
parent 68e6436b34
commit 542d214473
4 changed files with 20 additions and 2 deletions

View File

@ -35,7 +35,7 @@
<MenuItem Header="繁體中文" CommandParameter="zh-Hant" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="日本語" CommandParameter="ja" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="English" CommandParameter="en" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="喵ニャーMeow🐱🐈" CommandParameter="en-PN" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="喵ニャーMeow🐱🐈" x:Name="JokeLangSelectionMenuItem" CommandParameter="en-PN" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<Separator/>
<MenuItem Header="参与翻译" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/link/translate/">
<MenuItem.Icon>

View File

@ -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

View File

@ -65,7 +65,7 @@
<MenuItem Header="繁體中文" CommandParameter="zh-Hant" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="日本語" CommandParameter="ja" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="English" CommandParameter="en" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="喵ニャーMeow🐱🐈" CommandParameter="en-PN" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<MenuItem Header="喵ニャーMeow🐱🐈" x:Name="JokeLangSelectionMenuItem" CommandParameter="en-PN" Command="{Binding Source={x:Static l:LocalizeDictionary.Instance}, Path=SetCultureCommand}"/>
<Separator/>
<MenuItem Header="参与翻译" Command="{x:Static m:Commands.OpenLink}" CommandParameter="https://rec.danmuji.org/link/translate/">
<MenuItem.Icon>

View File

@ -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