Skip to content

Commit

Permalink
add I18N
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Nov 2, 2024
1 parent bfcb9c9 commit 743bd32
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@
<StackPanel Margin="10">
<CheckBox
VerticalContentAlignment="Center"
Content="允许变速播放音乐 (需要重启程序)"
Content="{markup:Translate [EnableVarspeed]}"
IsChecked="{Binding Setting.EnableVarspeed}" />
<StackPanel
Margin="20,10,0,0"
IsEnabled="{Binding Setting.EnableVarspeed}"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="变速采样缓存时间窗口" />
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [VarspeedReadDurationMs]}" />
<TextBox
Width="50"
Margin="5,0"
VerticalAlignment="Center"
Text="{Binding Setting.VarspeedReadDurationMs}">
</TextBox>
<TextBlock VerticalAlignment="Center" Text="毫秒" />
<TextBlock VerticalAlignment="Center" Text="{markup:Translate [Millisecond]}" />
</StackPanel>
</StackPanel>
</GroupBox>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Caliburn.Micro;
using MahApps.Metro.Controls;
using OngekiFumenEditor.Kernel.KeyBinding;
using OngekiFumenEditor.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
Expand Down Expand Up @@ -54,7 +55,8 @@ private void OnKeyUp(object sender, KeyEventArgs e)

var key = (e.Key == Key.System ? e.SystemKey : e.Key);

if (Definition.Key == Key.None) {
if (Definition.Key == Key.None)
{
TryClearModifier(key);
}

Expand All @@ -68,7 +70,8 @@ private void OnKeyDown(object sender, KeyEventArgs e)

var key = (e.Key == Key.System ? e.SystemKey : e.Key);

if (TryGetModifier(key, out var modifier)) {
if (TryGetModifier(key, out var modifier))
{
this.modifier = modifier;
this.key = Key.None;
}
Expand Down Expand Up @@ -141,7 +144,7 @@ private void Button_Click_1(object sender, RoutedEventArgs e)
{
if (ConflictDefinition is not null)
{
if (MessageBox.Show($"你绑定的键位和 {ConflictDefinition.DisplayName} 冲突, 如果继续绑定则清空对方冲突的键位, 是否继续?", "警告", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
if (MessageBox.Show(Properties.Resources.ConflictNotifyComfirm.Format(ConflictDefinition.DisplayName), Properties.Resources.Warning, MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return;
}
UpdateExpression();
Expand Down
40 changes: 38 additions & 2 deletions OngekiFumenEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions OngekiFumenEditor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@
<value>Mirror lane colors</value>
</data>
<data name="NoLimit" xml:space="preserve">
<value>x</value>
<value>(No Limit)</value>
</data>
<data name="ProgramCommandDescriptionSvg" xml:space="preserve">
<value>Generate a preview image for a chart</value>
Expand Down Expand Up @@ -1996,6 +1996,18 @@
<value>Change type of dockable lane</value>
</data>
<data name="SelectOneDockableLaneOnly" xml:space="preserve">
<value />
<value>Please select a dockable lane</value>
</data>
<data name="EnableVarspeed" xml:space="preserve">
<value>Allow variable speed music playback (requires program restart)</value>
</data>
<data name="VarspeedReadDurationMs" xml:space="preserve">
<value>Sampling audio buffer window size</value>
</data>
<data name="Millisecond" xml:space="preserve">
<value>ms</value>
</data>
<data name="ConflictNotifyComfirm" xml:space="preserve">
<value>The key you bind to conflicts with {0}, if you continue to bind, the conflicting key will be cleared, do you want to continue?</value>
</data>
</root>
82 changes: 82 additions & 0 deletions OngekiFumenEditor/Properties/Resources.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@
<data name="BulletType" xml:space="preserve">
<value>子弹形状</value>
</data>
<data name="BatchModeDeleteRangeOfObjectType" xml:space="preserve">
<value>批量删除 {0} (x{1})</value>
</data>
<data name="CallAcbGeneratorFuckFail" xml:space="preserve">
<value>调用AcbGeneratorFuck.Generator.Generate()失败</value>
</data>
Expand Down Expand Up @@ -471,6 +474,9 @@
<data name="DeleteObjects" xml:space="preserve">
<value>删除物件</value>
</data>
<data name="DeleteSpecificObject" xml:space="preserve">
<value>删除 {0}</value>
</data>
<data name="DeleteSelectedPalletes" xml:space="preserve">
<value>删除已选的子弹类型</value>
</data>
Expand Down Expand Up @@ -1866,6 +1872,67 @@
<data name="InvalidColorId" xml:space="preserve">
<value>颜色Id(ColorId)值无效: {0}</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="BatchModeAddObject" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="BatchModeModifierAddToSelection" xml:space="preserve">
<value>添加并选中</value>
</data>
<data name="LaneLeft" xml:space="preserve">
<value>红线</value>
</data>
<data name="LaneCenter" xml:space="preserve">
<value>绿线</value>
</data>
<data name="LaneRight" xml:space="preserve">
<value>蓝钱</value>
</data>
<data name="WallLeft" xml:space="preserve">
<value>左墙</value>
</data>
<data name="WallRight" xml:space="preserve">
<value>右墙</value>
</data>
<data name="Tap" xml:space="preserve">
<value>Tap</value>
</data>
<data name="Hold" xml:space="preserve">
<value>Hold</value>
</data>
<data name="Flick" xml:space="preserve">
<value>Flick</value>
</data>
<data name="LaneBlock" xml:space="preserve">
<value>锁边</value>
</data>
<data name="LaneColorful" xml:space="preserve">
<value>彩色装饰轨道</value>
</data>
<data name="BatchModeModifierSetCritical" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="BatchModeModifierSwitchDirection" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="ObjectFilterLanes" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="Bell" xml:space="preserve">
<value>Bell</value>
</data>
<data name="Clipboard" xml:space="preserve">
<value>剪贴板</value>
</data>
<data name="Objects" xml:space="preserve">
<value>物件</value>
</data>
<data name="CannotBatchInputClipboardEmpty" xml:space="preserve">
<value>剪贴板为空</value>
</data>
<data name="CannotBatchInputClipboardNotBrushable" xml:space="preserve">
<value>剪贴板里的内容并不支持批量操作</value>
</data>
<data name="kbd_layer_Normal" xml:space="preserve">
<value>通常模式</value>
</data>
Expand All @@ -1875,7 +1942,22 @@
<data name="kbd_layer_Batch" xml:space="preserve">
<value>批量模式</value>
</data>
<data name="kbd_editor_ChangeDockableLaneType" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="SelectOneDockableLaneOnly" xml:space="preserve">
<value>请选择单独选择一个可击打轨道节点</value>
</data>
<data name="EnableVarspeed" xml:space="preserve">
<value>允许变速播放音乐 (需要重启程序)</value>
</data>
<data name="VarspeedReadDurationMs" xml:space="preserve">
<value>变速采样缓存时间窗口</value>
</data>
<data name="Millisecond" xml:space="preserve">
<value>毫秒</value>
</data>
<data name="ConflictNotifyComfirm" xml:space="preserve">
<value>你绑定的键位和 {0} 冲突, 如果继续绑定则清空对方冲突的键位, 是否继续?</value>
</data>
</root>

0 comments on commit 743bd32

Please sign in to comment.