Skip to content

Commit

Permalink
improve select language page
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Dec 29, 2023
1 parent e0311c1 commit 4faf70d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/Starward/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,13 @@ private void InitializeLanguage()
{
try
{
var lang = AppConfig.Language;
if (!string.IsNullOrWhiteSpace(lang))
if (!string.IsNullOrWhiteSpace(AppConfig.UserDataFolder))
{
CultureInfo.CurrentUICulture = new CultureInfo(lang);
var lang = AppConfig.Language;
if (!string.IsNullOrWhiteSpace(lang))
{
CultureInfo.CurrentUICulture = new CultureInfo(lang);
}
}
}
catch { }
Expand Down
2 changes: 0 additions & 2 deletions src/Starward/MyWindows/WelcomeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Starward.Pages.Welcome;
using Starward.Services;
using System;
using System.Globalization;
using System.IO;
using Vanara.PInvoke;
using Windows.Graphics;
Expand Down Expand Up @@ -33,7 +32,6 @@ public WelcomeWindow()
Current = this;
this.InitializeComponent();
InitializeWindow();
CultureInfo.CurrentUICulture = CultureInfo.InstalledUICulture;
}


Expand Down
8 changes: 4 additions & 4 deletions src/Starward/Pages/Welcome/SelectLanguagePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<TextBlock FontSize="20"
FontWeight="SemiBold"
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
Text="Language" />
Text="{x:Bind lang:Lang.SettingPage_Language}" />
<ComboBox Name="ComboBox_Language"
MinWidth="300"
SelectionChanged="ComboBox_Language_SelectionChanged" />
Expand All @@ -71,7 +71,7 @@
FontSize="20"
FontWeight="SemiBold"
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
Text="Windows Size" />
Text="{x:Bind lang:Lang.SettingPage_WindowsSize}" />
<StackPanel Margin="0,-4,0,0"
Orientation="Horizontal"
Spacing="16">
Expand All @@ -81,7 +81,7 @@
Tag="normal">
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon FontSize="16" Glyph="&#xE740;" />
<TextBlock Text="Normal" />
<TextBlock Text="{x:Bind lang:Lang.SettingPage_Normal}" />
</StackPanel>
</RadioButton>
<RadioButton Name="RadioButton_WindowSize_Small"
Expand All @@ -90,7 +90,7 @@
Tag="small">
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon FontSize="16" Glyph="&#xE73F;" />
<TextBlock Text="Small" />
<TextBlock Text="{x:Bind lang:Lang.SettingPage_Small}" />
</StackPanel>
</RadioButton>
</StackPanel>
Expand Down

0 comments on commit 4faf70d

Please sign in to comment.