Skip to content

Tomato #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Optimized translation
  • Loading branch information
dimojang committed Mar 28, 2021
commit 484c9167e14ec41b9a4870e805e8fd4a83afde97
1 change: 1 addition & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected override void OnStartup(StartupEventArgs e)
break;
default: //english default
dict.Source = new Uri(@"Resources\Language\en-US.xaml", UriKind.Relative);
ConfigHelper.Instance.SetLang("en");
break;
}
Current.Resources.MergedDictionaries.Add(dict);
Expand Down
1 change: 0 additions & 1 deletion Frogy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\Language\LanguageHelper.cs" />
<Compile Include="Resources\Theme\ThemeHelper.cs" />
<Compile Include="ViewModels\DashboardViewModel.cs" />
<Compile Include="ViewModels\OptionViewModel.cs" />
<Compile Include="ViewModels\OverViewViewModel.cs" />
Expand Down
2 changes: 2 additions & 0 deletions Resources/Language/en-US.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
<system:String x:Key="Option_LanguageTitle">Launage</system:String>
<system:String x:Key="Option_Info">*Some of the setting(s) will take effect after restarting Frogy.</system:String>
<system:String x:Key="Option_ThemeTitle">Theme</system:String>
<system:String x:Key="Option_ThemeDefault">Default</system:String>
<system:String x:Key="Option_ThemeNight">Night</system:String>

</ResourceDictionary>
2 changes: 2 additions & 0 deletions Resources/Language/zh-CN.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@
<system:String x:Key="Option_LanguageTitle">语言</system:String>
<system:String x:Key="Option_Info">*部分设置在重启 时常 后生效。</system:String>
<system:String x:Key="Option_ThemeTitle">主题</system:String>
<system:String x:Key="Option_ThemeDefault">默认</system:String>
<system:String x:Key="Option_ThemeNight">夜晚</system:String>

</ResourceDictionary>
8 changes: 6 additions & 2 deletions Resources/Theme/DarkTheme.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">

xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="en-US">Dark</system:String>
<system:String x:Key="zh-CN">夜间模式</system:String>

<Style x:Key="DefaultChartStyle" TargetType="lvc:CartesianChart">
<Setter Property="Foreground" Value="White"/>
</Style>
Expand Down
7 changes: 5 additions & 2 deletions Resources/Theme/DefaultTheme.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:system="clr-namespace:System;assembly=mscorlib">

<system:String x:Key="en-US">Default</system:String>
<system:String x:Key="zh-CN">默认</system:String>

<Style x:Key="DefaultChartStyle" TargetType="lvc:CartesianChart">
<Setter Property="Foreground" Value="Black"/>
Expand Down
21 changes: 0 additions & 21 deletions Resources/Theme/ThemeHelper.cs

This file was deleted.

15 changes: 0 additions & 15 deletions ViewModels/OptionViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Windows.Input;

using Frogy.Resources.Language;
using Frogy.Resources.Theme;
using System.Windows.Controls;

namespace Frogy.ViewModels
Expand Down Expand Up @@ -116,20 +115,6 @@ public int LanguageListSelectedIndex
#endregion

#region Theme setting
private List<string> themeList = new List<string>();
public List<string> ThemeList
{
get
{
themeList.Clear();

foreach (KeyValuePair<int, string> pair in ThemeHelper.ThemeSets)
themeList.Add(pair.Value);

return themeList;
}
}

private int themeListSelectedIndex = ((App)Application.Current).appData.ThemeSetting >= 0 && ((App)Application.Current).appData.ThemeSetting <= 1 ?
((App)Application.Current).appData.ThemeSetting : 0;
public int ThemeListSelectedIndex
Expand Down
8 changes: 2 additions & 6 deletions Views/OptionView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,9 @@
<StackPanel Margin="10"
Orientation="Horizontal">
<ComboBox Margin="5"
ItemsSource="{Binding Path=ThemeList}"
SelectedIndex="{Binding Path=ThemeListSelectedIndex}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBoxItem Content="{DynamicResource Option_ThemeDefault}"/>
<ComboBoxItem Content="{DynamicResource Option_ThemeNight}"/>
</ComboBox>
</StackPanel>

Expand Down