Skip to content

Commit cab0758

Browse files
authored
Merge pull request Blinue#33 from neoKushan/feature/localisation
Merge from neoKushan/feature/localisation
2 parents 8e1dde7 + 32d4d6f commit cab0758

16 files changed

+895
-62
lines changed

‎Magpie/Assets/BuiltInScaleModels.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
]
8888
},
8989
{
90-
"name": "像素 2x",
90+
"name": "Pixel Scale 2x",
9191
"model": [
9292
{
9393
"module": "Common",
@@ -97,7 +97,7 @@
9797
]
9898
},
9999
{
100-
"name": "像素 3x",
100+
"name": "Pixel Scale 3x",
101101
"model": [
102102
{
103103
"module": "Common",
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
[
2+
{
3+
"name": "Lanczos",
4+
"model": [
5+
{
6+
"module": "Common",
7+
"effect": "lanczos",
8+
"scale": [ -1, -1 ],
9+
"ARStrength": 0.7
10+
},
11+
{
12+
"module": "Common",
13+
"effect": "adaptiveSharpen",
14+
"curveHeight": 0.6
15+
}
16+
]
17+
},
18+
{
19+
"name": "RAVU",
20+
"model": [
21+
{
22+
"module": "RAVU",
23+
"effect": "RAVUZoom",
24+
"scale": [ -1, -1 ]
25+
},
26+
{
27+
"module": "Anime4K",
28+
"effect": "denoiseBilateral",
29+
"variant": "mode"
30+
}
31+
]
32+
},
33+
{
34+
"name": "FSRCNNX",
35+
"model": [
36+
{
37+
"module": "FSRCNNX",
38+
"effect": "FSRCNNX"
39+
},
40+
{
41+
"module": "Common",
42+
"effect": "mitchell",
43+
"scale": [ -1, -1 ],
44+
"variant": "catrom"
45+
}
46+
]
47+
},
48+
{
49+
"name": "ACNet",
50+
"model": [
51+
{
52+
"module": "ACNet"
53+
},
54+
{
55+
"module": "Common",
56+
"effect": "mitchell",
57+
"scale": [ -1, -1 ],
58+
"variant": "catrom"
59+
}
60+
]
61+
},
62+
{
63+
"name": "Anime4K",
64+
"model": [
65+
{
66+
"module": "Anime4K",
67+
"effect": "Anime4K",
68+
"curveHeight": 0.3,
69+
"useDenoiseVersion": true
70+
},
71+
{
72+
"module": "Common",
73+
"effect": "mitchell",
74+
"scale": [ -1, -1 ],
75+
"variant": "catrom"
76+
}
77+
]
78+
},
79+
{
80+
"name": "FSR",
81+
"model": [
82+
{
83+
"module": "FFX",
84+
"effect": "FSR",
85+
"scale": [-1, -1]
86+
}
87+
]
88+
},
89+
{
90+
"name": "像素 2x",
91+
"model": [
92+
{
93+
"module": "Common",
94+
"effect": "pixelScale",
95+
"scale": 2
96+
}
97+
]
98+
},
99+
{
100+
"name": "像素 3x",
101+
"model": [
102+
{
103+
"module": "Common",
104+
"effect": "pixelScale",
105+
"scale": 3
106+
}
107+
]
108+
}
109+
]

‎Magpie/Magpie.csproj‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@
179179
<DesignTime>True</DesignTime>
180180
<DependentUpon>Resources.resx</DependentUpon>
181181
</Compile>
182+
<Compile Include="Properties\Resources.zh-CN.Designer.cs">
183+
<AutoGen>True</AutoGen>
184+
<DesignTime>True</DesignTime>
185+
<DependentUpon>Resources.zh-CN.resx</DependentUpon>
186+
</Compile>
182187
<Compile Include="Properties\Settings.Designer.cs">
183188
<AutoGen>True</AutoGen>
184189
<DependentUpon>Settings.settings</DependentUpon>
@@ -188,7 +193,12 @@
188193
<Generator>PublicResXFileCodeGenerator</Generator>
189194
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
190195
</EmbeddedResource>
196+
<EmbeddedResource Include="Properties\Resources.zh-CN.resx">
197+
<Generator>PublicResXFileCodeGenerator</Generator>
198+
<LastGenOutput>Resources.zh-CN.Designer.cs</LastGenOutput>
199+
</EmbeddedResource>
191200
<None Include="Assets\BuiltInScaleModels.json" />
201+
<None Include="Assets\BuiltInScaleModels.zh-CN.json" />
192202
<None Include="packages.config" />
193203
<None Include="Properties\Settings.settings">
194204
<Generator>PublicSettingsSingleFileGenerator</Generator>

‎Magpie/MainWindow.xaml‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:tb="http://www.hardcodet.net/taskbar"
77
xmlns:local="clr-namespace:Magpie"
8+
xmlns:p="clr-namespace:Magpie.Properties;assembly=Magpie"
89
mc:Ignorable="d"
910
Title="Magpie" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen"
1011
Closing="Window_Closing" SourceInitialized="Window_SourceInitialized" StateChanged="Window_StateChanged" HorizontalAlignment="Left" VerticalAlignment="Top" SizeToContent="Height" Width="388">
@@ -29,7 +30,7 @@
2930
<Label Style="{StaticResource ContextMenuItemFontIcon}" Content="&#xEDA7;" />
3031
</MenuItem.Icon>
3132
</MenuItem>
32-
<MenuItem Header="5秒后缩放" Name="cmiScale" Click="CmiScale_Click">
33+
<MenuItem Header="5Zoom_In_After_5S" Name="cmiScale" Click="CmiScale_Click">
3334
<MenuItem.Icon>
3435
<Label Style="{StaticResource ContextMenuItemFontIcon}" Content="&#xE916;" />
3536
</MenuItem.Icon>
@@ -40,7 +41,7 @@
4041
<Label Style="{StaticResource ContextMenuItemFontIcon}" Content="&#xE737;" />
4142
</MenuItem.Icon>
4243
</MenuItem>
43-
<MenuItem Header="选项" Click="CmiOptions_Click">
44+
<MenuItem Header="Options" Click="CmiOptions_Click">
4445
<MenuItem.Icon>
4546
<Label Style="{StaticResource ContextMenuItemFontIcon}" Content="&#xE713;" />
4647
</MenuItem.Icon>
@@ -80,28 +81,28 @@
8081
<RowDefinition/>
8182
</Grid.RowDefinitions>
8283

83-
<Label Style="{StaticResource Col0}" Content="热键" VerticalAlignment="Top" Margin="0,5,0,0" Padding="0,5,5,5"/>
84+
<Label Style="{StaticResource Col0}" Content="{x:Static p:Resources.Hotkey}" VerticalAlignment="Top" Margin="0,5,0,0" Padding="0,5,5,5"/>
8485
<TextBox x:Name="txtHotkey" Grid.Column="1" Margin="10,5,10,0" VerticalAlignment="Top" Padding="1,3" TextChanged="TxtHotkey_TextChanged" >
8586
<TextBox.ContextMenu>
8687
<ContextMenu/>
8788
</TextBox.ContextMenu>
8889
</TextBox>
89-
<Button Content="5秒后缩放" Name="btnScale" Click="BtnScale_Click" Grid.Column="2" HorizontalAlignment="Right" Margin="0,5,0,0" VerticalAlignment="Top" Padding="10,3" Width="80"/>
90+
<Button Content="{x:Static p:Resources.Zoom_In_After_5S}" Name="btnScale" Click="BtnScale_Click" Grid.Column="2" HorizontalAlignment="Right" Margin="0,5,0,0" VerticalAlignment="Top" Padding="10,3"/>
9091

91-
<Label Style="{StaticResource Col0}" Content="缩放模式" Grid.Row="1" VerticalAlignment="Center" Margin="0,20,0,0" Padding="0,5,5,5" />
92+
<Label Style="{StaticResource Col0}" Content="{x:Static p:Resources.Scaling_Mode}" Grid.Row="1" VerticalAlignment="Center" Margin="0,20,0,0" Padding="0,5,5,5" />
9293
<ComboBox Name="cbbScaleMode" Grid.Row="1" SelectionChanged="CbbScaleMode_SelectionChanged" Margin="10,20,10,0" />
9394

94-
<Label Style="{StaticResource Col0}" Content="抓取模式" Grid.Row="2" VerticalAlignment="Center" Margin="0,10,0,0" Padding="0,5,5,5"/>
95+
<Label Style="{StaticResource Col0}" Content="{x:Static p:Resources.Capture_Mode}" Grid.Row="2" VerticalAlignment="Top" Margin="0,9.667,0.333,0" Padding="0,5,5,5"/>
9596
<ComboBox Name="cbbCaptureMode" Grid.Row="2" SelectionChanged="CbbCaptureMode_SelectionChanged" Margin="10,10,10,0">
9697
<ComboBoxItem Content="WinRT Capture" />
9798
<ComboBoxItem Content="GDI" />
9899
</ComboBox>
99100

100-
<Label Style="{StaticResource Col0}" Content="进程注入" Grid.Row="3" VerticalAlignment="Center" Margin="0,10,0,0" Padding="0,5,5,5"/>
101+
<Label Style="{StaticResource Col0}" Content="{x:Static p:Resources.Injection_Mode}" Grid.Row="3" VerticalAlignment="Center" Margin="0,10,0,0" Padding="0,5,5,5"/>
101102
<ComboBox Name="cbbInjectMode" Grid.Row="3" SelectionChanged="CbbInjectMode_SelectionChanged" Margin="10,10,10,0">
102-
<ComboBoxItem Content="不注入" />
103-
<ComboBoxItem Content="运行时注入" />
104-
<ComboBoxItem Content="启动时注入" />
103+
<ComboBoxItem Content="{x:Static p:Resources.No_Injection}" />
104+
<ComboBoxItem Content="{x:Static p:Resources.Runtime_Injection}" />
105+
<ComboBoxItem Content="{x:Static p:Resources.Injection_At_Startup}" />
105106
</ComboBox>
106107
</Grid>
107108

@@ -115,14 +116,14 @@
115116
<ColumnDefinition />
116117
<ColumnDefinition Width="Auto" />
117118
</Grid.ColumnDefinitions>
118-
<TextBlock x:Name="tbCurWndTitle" Margin="0" Text="当前窗口" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
119+
<TextBlock x:Name="tbCurWndTitle" Margin="0" Text="Current_Window" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
119120
<Button Content="取消" Margin="5,0,0,0" VerticalAlignment="Center" Padding="5,2" Click="BtnCancelRestore_Click" Grid.Column="1"/>
120121
</Grid>
121122

122123
<Button Click="BtnOptions_Click" Margin="10,0,0,0" VerticalAlignment="Center" Padding="10,5" Grid.Column="1" HorizontalAlignment="Right">
123124
<StackPanel Orientation="Horizontal">
124125
<Label FontFamily="Segoe MDL2 Assets" Content="&#xE713;" Padding="0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="0" />
125-
<Label Content="选项" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="0" Margin="5,0,0,0" />
126+
<Label Content="{x:Static p:Resources.Options}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Padding="0" Margin="5,0,0,0" />
126127
</StackPanel>
127128
</Button>
128129
</Grid>

‎Magpie/MainWindow.xaml.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public partial class MainWindow : Window {
3939

4040
private IntPtr Handle;
4141

42-
// 不为零时表示全屏窗口不是因为热键关闭的
42+
// 不为零时表示全屏窗口不是因为Hotkey关闭的
4343
private IntPtr prevSrcWindow = IntPtr.Zero;
4444
private readonly DispatcherTimer timerRestore = new DispatcherTimer {
4545
Interval = new TimeSpan(0, 0, 0, 0, 200)
@@ -83,7 +83,7 @@ private void TimerRestore_Tick(object sender, EventArgs e) {
8383
return;
8484
}
8585

86-
tbCurWndTitle.Text = "当前窗口:" + NativeMethods.GetWindowTitle(prevSrcWindow);
86+
tbCurWndTitle.Text = $"{Properties.Resources.Current_Window}{NativeMethods.GetWindowTitle(prevSrcWindow)}";
8787
gridAutoRestore.Visibility = Visibility.Visible;
8888
}
8989

@@ -144,7 +144,7 @@ private void LoadScaleModels() {
144144
scaleModels = null;
145145

146146
cbbScaleMode.Items.Clear();
147-
_ = cbbScaleMode.Items.Add("<解析失败>");
147+
_ = cbbScaleMode.Items.Add($"<{Properties.Resources.Parse_Failure}>");
148148
}
149149
}
150150

@@ -287,7 +287,7 @@ private void StartScaleTimer() {
287287

288288
private void StopScaleTimer() {
289289
timerScale.Stop();
290-
btnScale.Content = cmiScale.Header = "5秒后放大";
290+
btnScale.Content = cmiScale.Header = Properties.Resources.Zoom_In_After_5S;
291291
}
292292

293293
private void ToggleScaleTimer() {

‎Magpie/Options/AboutOptionsPage.xaml‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:Magpie.Options"
7+
xmlns:p="clr-namespace:Magpie.Properties;assembly=Magpie"
78
mc:Ignorable="d"
89
d:DesignHeight="300" d:DesignWidth="400"
910
Title="AboutOptionsPage">
@@ -21,10 +22,10 @@
2122
<Image Height="28" Source="{StaticResource Logo}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
2223
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
2324
<Label Content="MAGPIE" Margin="5,0,0,-3" VerticalAlignment="Top" FontSize="20" Padding="0" HorizontalAlignment="Left"/>
24-
<Label Name="lblVersion" Content="版本" Padding="0" Margin="10,0,0,0" VerticalAlignment="Bottom" FontSize="11" />
25+
<Label Name="lblVersion" Content="{x:Static p:Resources.Version}" Padding="0" Margin="10,0,0,0" VerticalAlignment="Bottom" FontSize="11" />
2526
</StackPanel>
2627
</StackPanel>
27-
<Button Content="开源许可" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center" Click="BtnLicense_Click" />
28+
<Button Content="{x:Static p:Resources.Open_Source_Licenses}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center" Click="BtnLicense_Click" />
2829
</Grid>
2930

3031
<Grid Margin="0,20,0,0">
@@ -33,7 +34,7 @@
3334
<ColumnDefinition />
3435
</Grid.ColumnDefinitions>
3536

36-
<Label Content="支持" Padding="0" FontWeight="Bold" />
37+
<Label Content="{x:Static p:Resources.Support}" Padding="0" FontWeight="Bold" />
3738
<Separator Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="1"/>
3839
</Grid>
3940
<Grid Margin="5,5,0,0">
@@ -47,13 +48,13 @@
4748
<RowDefinition />
4849
</Grid.RowDefinitions>
4950

50-
<Label Content="项目地址" Padding="5" HorizontalAlignment="Left" VerticalAlignment="Center" />
51+
<Label Content="{x:Static p:Resources.Project_URL}" Padding="5" HorizontalAlignment="Left" VerticalAlignment="Center" />
5152
<TextBlock Grid.Column="1" Padding="5">
5253
<Hyperlink NavigateUri="https://github.com/Blinue/Magpie" RequestNavigate="Hyperlink_RequestNavigate">
5354
https://github.com/Blinue/Magpie
5455
</Hyperlink>
5556
</TextBlock>
56-
<Label Content="反馈" Grid.Row="1" Padding="5" Grid.RowSpan="2" HorizontalAlignment="Left" VerticalAlignment="Center" />
57+
<Label Content="{x:Static p:Resources.Feedback}" Grid.Row="1" Padding="5" Grid.RowSpan="2" HorizontalAlignment="Left" VerticalAlignment="Center" />
5758
<TextBlock Grid.Column="1" Grid.Row="1" Padding="5">
5859
<Hyperlink NavigateUri="https://github.com/Blinue/Magpie/issues" RequestNavigate="Hyperlink_RequestNavigate">
5960
https://github.com/Blinue/Magpie/issues
@@ -72,7 +73,7 @@
7273
<ColumnDefinition />
7374
</Grid.ColumnDefinitions>
7475

75-
<Label Content="鸣谢" Padding="0" FontWeight="Bold" />
76+
<Label Content="{x:Static p:Resources.Thanks}" Padding="0" FontWeight="Bold" />
7677
<Separator Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="1"/>
7778
</Grid>
7879
<Grid Margin="5,5,0,0">
@@ -87,26 +88,26 @@
8788
<RowDefinition />
8889
<RowDefinition />
8990
</Grid.RowDefinitions>
90-
<Label Content="Visual Studio" Padding="5" />
91+
<Label Content="{x:Static p:Resources.Visual_Studio}" Padding="5" />
9192
<TextBlock Grid.Column="1" Padding="5">
9293
<Hyperlink NavigateUri="https://visualstudio.microsoft.com/" RequestNavigate="Hyperlink_RequestNavigate">
9394
https://visualstudio.microsoft.com/
9495
</Hyperlink>
9596
</TextBlock>
96-
<Label Content="EasyHook" Padding="5" Grid.Row="1" />
97+
<Label Content="{x:Static p:Resources.EasyHook}" Padding="5" Grid.Row="1" />
9798
<TextBlock Grid.Column="1" Padding="5" Grid.Row="1">
9899
<Hyperlink NavigateUri="https://github.com/EasyHook/EasyHook" RequestNavigate="Hyperlink_RequestNavigate">
99100
https://github.com/EasyHook/EasyHook
100101
</Hyperlink>
101102
</TextBlock>
102-
<Label Content="C++/WinRT" Padding="5" Grid.Row="2" />
103+
<Label Content="{x:Static p:Resources.Cpp_WinRT}" Padding="5" Grid.Row="2" />
103104
<TextBlock Grid.Column="1" Padding="5" Grid.Row="2">
104105
<Hyperlink NavigateUri="https://github.com/microsoft/cppwinrt" RequestNavigate="Hyperlink_RequestNavigate">
105106
https://github.com/microsoft/cppwinrt
106107
</Hyperlink>
107108
</TextBlock>
108-
<TextBlock Text="Magpie移植的所有优秀着色器项目" Grid.Row="3" Grid.ColumnSpan="2" Padding="5" />
109-
<TextBlock Text="所有为Magpie提供反馈与贡献的人" Grid.Row="4" Grid.ColumnSpan="2" Padding="5" />
109+
<TextBlock Text="{x:Static p:Resources.All_Shaders_Thanks_Text}" Grid.Row="3" Grid.ColumnSpan="2" Padding="5" />
110+
<TextBlock Text="{x:Static p:Resources.All_Contributors_Thanks_Text}" Grid.Row="4" Grid.ColumnSpan="2" Padding="5" />
110111
</Grid>
111112
</StackPanel>
112113
</Page>

‎Magpie/Options/AboutOptionsPage.xaml.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class AboutOptionsPage : Page {
1414
public AboutOptionsPage() {
1515
InitializeComponent();
1616

17-
lblVersion.Content = "版本 " + App.APP_VERSION.ToString(3);
17+
lblVersion.Content = $"{Properties.Resources.Version} {App.APP_VERSION.ToString(3)}";
1818
}
1919

2020
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) {

‎Magpie/Options/AdvancedOptionsPage.xaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:Magpie.Options"
77
xmlns:props="clr-namespace:Magpie.Properties"
8+
xmlns:p="clr-namespace:Magpie.Properties;assembly=Magpie"
89
mc:Ignorable="d"
910
d:DesignHeight="200" d:DesignWidth="400"
1011
Title="AdvancedOptionsPage">
@@ -18,9 +19,9 @@
1819

1920
<StackPanel>
2021
<StackPanel Orientation="Horizontal">
21-
<Label Content="日志级别" Padding="0" VerticalContentAlignment="Center" />
22+
<Label Content="{x:Static p:Resources.Logging_Level}" Padding="0" VerticalContentAlignment="Center" />
2223
<ComboBox Margin="10,0,0,0" />
2324
</StackPanel>
24-
<CheckBox Content="显示帧率" Margin="0,20,0,0" IsChecked="{Binding Source={x:Static props:Settings.Default},Path=ShowFPS,Mode=TwoWay}"/>
25+
<CheckBox Content="{x:Static p:Resources.Show_Frame_Rate}" Margin="0,20,0,0" IsChecked="{Binding Source={x:Static props:Settings.Default},Path=ShowFPS,Mode=TwoWay}"/>
2526
</StackPanel>
2627
</Page>

0 commit comments

Comments
 (0)