Skip to content
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

Add Chinese translation for the UI interface #37

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions GenshinLyreMidiPlayer.Data/Entities/Transpose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace GenshinLyreMidiPlayer.Data.Entities;

public enum Transpose
{
[Description("Ignore missing notes")] Ignore,
[Description("Transpose up")] Up,
[Description("Transpose down")] Down
[Description("忽略遗漏的记录")] Ignore,
[Description("向上移调")] Up,
[Description("向下移调")] Down
}
8 changes: 4 additions & 4 deletions GenshinLyreMidiPlayer.WPF/Core/Keyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public enum Layout

public static readonly Dictionary<Instrument, string> InstrumentNames = new()
{
[Instrument.WindsongLyre] = "Windsong Lyre",
[Instrument.FloralZither] = "Floral Zither",
[Instrument.VintageLyre] = "Vintage Lyre"
[Instrument.WindsongLyre] = "风物之诗琴",
[Instrument.FloralZither] = "镜花之琴",
[Instrument.VintageLyre] = "老旧的诗琴"
};

public static readonly Dictionary<Layout, string> LayoutNames = new()
{
[Layout.QWERTY] = "QWERTY",
[Layout.QWERTY] = "QWERTY标准键盘",
[Layout.QWERTZ] = "QWERTZ",
[Layout.AZERTY] = "AZERTY",
[Layout.DVORAK] = "DVORAK",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ public static class TransitionCollection
{
public static List<CaptionedObject<Transition>> Transitions = new()
{
new(new EntranceTransition(), "Entrance"),
new(new DrillInTransition(), "Drill in"),
new(new SlideTransition(Direction.FromLeft), "Slide from Left"),
new(new SlideTransition(Direction.FromRight), "Slide from Right"),
new(new SlideTransition(Direction.FromBottom), "Slide from Bottom"),
new(new SuppressTransition(), "Suppress")
new(new EntranceTransition(), "输入"),
new(new DrillInTransition(), "键入"),
new(new SlideTransition(Direction.FromLeft), "从左侧滑动"),
new(new SlideTransition(Direction.FromRight), "从右侧滑动"),
new(new SlideTransition(Direction.FromBottom), "从底部滑动"),
new(new SuppressTransition(), "")
};
}
6 changes: 3 additions & 3 deletions GenshinLyreMidiPlayer.WPF/ModernWPF/Theme/AppTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ private AppTheme(string name, ApplicationTheme? value)

public ApplicationTheme? Value { get; }

public static AppTheme Dark { get; } = new("Dark", ApplicationTheme.Dark);
public static AppTheme Dark { get; } = new("黑暗", ApplicationTheme.Dark);

public static AppTheme Default { get; } = new("Use system setting", null);
public static AppTheme Default { get; } = new("跟随系统设置", null);

public static AppTheme Light { get; } = new("Light", ApplicationTheme.Light);
public static AppTheme Light { get; } = new("明亮", ApplicationTheme.Light);

public string Name { get; }

Expand Down
16 changes: 8 additions & 8 deletions GenshinLyreMidiPlayer.WPF/ViewModels/LyrePlayerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public LyrePlayerViewModel(IContainer ioc, MainWindowViewModel main)
}
catch (ArgumentException e)
{
new ErrorContentDialog(e, closeText: "Ignore").ShowAsync();
new ErrorContentDialog(e, closeText: "����").ShowAsync();

SettingsPage.CanUseSpeakers = false;
Settings.UseSpeakers = false;
Expand All @@ -79,7 +79,7 @@ public LyrePlayerViewModel(IContainer ioc, MainWindowViewModel main)

public BindableCollection<MidiInput> MidiInputs { get; } = new()
{
new("None")
new("��")
};

public BindableCollection<MidiTrack> MidiTracks { get; } = new();
Expand Down Expand Up @@ -251,7 +251,7 @@ public void OnSelectedMidiInputChanged()
_inputDevice?.Dispose();

if (SelectedMidiInput?.DeviceName is not null
&& SelectedMidiInput.DeviceName != "None")
&& SelectedMidiInput.DeviceName != "��")
{
_inputDevice = InputDevice.GetByName(SelectedMidiInput.DeviceName);

Expand Down Expand Up @@ -307,7 +307,7 @@ public void Previous()
public void RefreshDevices()
{
MidiInputs.Clear();
MidiInputs.Add(new("None"));
MidiInputs.Add(new("��"));

foreach (var device in InputDevice.GetAll())
{
Expand Down Expand Up @@ -399,10 +399,10 @@ await Application.Current.Dispatcher.Invoke(async () =>
var options = new Enum[] { Transpose.Up, Transpose.Down };
var exceptionDialog = new ErrorContentDialog(
new MissingNotesException(
"Some notes cannot be played by this instrument, and may play incorrectly. " +
"This can be solved by snapping to the nearest semitone. " +
"You can choose to shift the notes up or down, or ignore the missing notes."),
options, "Ignore");
"�������޷�����ijЩ���������ҿ����޷���ȷ���ࡣ " +
"�����ͨ����׽������İ���������� " +
"������ѡ�����ϻ������ƶ�����������Զ�ʧ��������"),
options, "����");

var result = await exceptionDialog.ShowAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class MainWindowViewModel : Conductor<IScreen>

public MainWindowViewModel(IContainer ioc, IThemeService theme)
{
Title = $"Genshin Lyre MIDI Player {SettingsPageViewModel.ProgramVersion}";
Title = $"Genshin Lyre MIDI Player ���룺Roly";//{SettingsPageViewModel.ProgramVersion}�汾��

_ioc = ioc;
_theme = theme;
Expand Down
28 changes: 14 additions & 14 deletions GenshinLyreMidiPlayer.WPF/ViewModels/SettingsPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public class SettingsPageViewModel : Screen
{
public static readonly Dictionary<Transpose, string> TransposeNames = new()
{
[Ignore] = "Ignore notes",
[Up] = "Shift one semitone up",
[Down] = "Shift one semitone down"
[Ignore] = "忽略注释",
[Up] = "上移一个半音",
[Down] = "下移一个半音"
};

private static readonly Settings Settings = Settings.Default;
Expand Down Expand Up @@ -183,7 +183,7 @@ public static string GenshinLocation

public string Key => $"Key: {KeyOffsets[KeyOffset]}";

public string TimerText => CanChangeTime ? "Start" : "Stop";
public string TimerText => CanChangeTime ? "开始" : "停止";

[UsedImplicitly] public string UpdateString { get; set; } = string.Empty;

Expand Down Expand Up @@ -227,19 +227,19 @@ public async Task CheckForUpdate()
if (IsCheckingUpdate)
return;

UpdateString = "Checking for updates...";
UpdateString = "检查更新中...";
IsCheckingUpdate = true;

try
{
LatestVersion = await GetLatestVersion() ?? new GitVersion();
UpdateString = LatestVersion.Version > ProgramVersion
? "(Update available!)"
? "(更新可用!)"
: string.Empty;
}
catch (Exception)
{
UpdateString = "Failed to check updates";
UpdateString = "检查更新失败";
}
finally
{
Expand All @@ -252,12 +252,12 @@ public async Task LocationMissing()
{
var dialog = new ContentDialog
{
Title = "Error",
Content = "Could not find Game's Location, please find GenshinImpact.exe or YuanShen.exe",
Title = "错误",
Content = "找不到游戏位置,请查找 GenshinImpact.exe YuanShen.exe",

PrimaryButtonText = "Find Manually...",
SecondaryButtonText = "Ignore (Notes might not play)",
CloseButtonText = "Exit"
PrimaryButtonText = "手动查找...",
SecondaryButtonText = "忽略(音符可能无法播放)",
CloseButtonText = "退出"
};

var result = await dialog.ShowAsync();
Expand Down Expand Up @@ -345,8 +345,8 @@ private async Task<bool> TrySetLocationAsync(string? location)
{
var dialog = new ContentDialog
{
Title = "Incorrect Location",
Content = "launcher.exe is not the game, please find GenshinImpact.exe",
Title = "位置不正确",
Content = "launcher.exe 不是游戏,请找GenshinImpact.exe 或 yuanshen.exe",

CloseButtonText = "Ok"
};
Expand Down
7 changes: 4 additions & 3 deletions GenshinLyreMidiPlayer.WPF/Views/LyrePlayerView.xaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="gbk"?>
<UserControl
x:Class="GenshinLyreMidiPlayer.WPF.Views.LyrePlayerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -27,7 +28,7 @@
<Button Command="{s:Action OpenFile}" Background="Transparent">
<ui:FontIcon Glyph="&#xE8E5;" FontFamily="Segoe MDL2 Assets" />
</Button>
<TextBlock VerticalAlignment="Center" Text="{Binding Playlist.OpenedFile.Title, Mode=OneWay, FallbackValue=Open...}" />
<TextBlock VerticalAlignment="Center" Text="{Binding Playlist.OpenedFile.Title, Mode=OneWay, FallbackValue=��...}" />
</modern:SimpleStackPanel>

<modern:SimpleStackPanel
Expand Down Expand Up @@ -79,7 +80,7 @@
Text="{Binding MaximumTime, StringFormat=m\\:ss}" />
</Grid>

<GroupBox Grid.Row="3" Header="MIDI Tracks">
<GroupBox Grid.Row="3" Header="MIDI ����">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand Down Expand Up @@ -114,7 +115,7 @@
</Grid>
</GroupBox>

<GroupBox Grid.Row="4" Header="MIDI Instrument">
<GroupBox Grid.Row="4" Header="MIDI ����">
<modern:SimpleStackPanel Orientation="Horizontal">
<ComboBox
ItemsSource="{Binding MidiInputs}"
Expand Down
17 changes: 9 additions & 8 deletions GenshinLyreMidiPlayer.WPF/Views/MainWindowView.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<ui:UiWindow
<?xml version="1.0" encoding="gbk"?>
<ui:UiWindow
x:Class="GenshinLyreMidiPlayer.WPF.Views.MainWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -34,7 +35,7 @@
New update!
</ui:Hyperlink>
<ui:AutoSuggestBox
MinWidth="200" MaxWidth="250" PlaceholderText="Search..."
MinWidth="200" MaxWidth="250" PlaceholderText="����..."
TextChanged="{s:Action SearchSong}" ItemsSource="{Binding PlaylistView.TrackTitles}"
Text="{Binding PlaylistView.FilterText}" />
</modern:SimpleStackPanel>
Expand Down Expand Up @@ -65,20 +66,20 @@
SelectedPageIndex="0" Navigated="{s:Action Navigate}"
Frame="{Binding ElementName=RootFrame, Mode=OneWay}">
<ui:NavigationStore.Items>
<ui:NavigationItem Content="Player" Icon="Play12"
<ui:NavigationItem Content="������" Icon="Play12"
PageType="{x:Type pages:LyrePlayerView}"
Tag="{Binding PlayerView}" />
<ui:NavigationSeparator />
<ui:NavigationItem Content="Playlist" Icon="TextBulletListSquareSearch20"
<ui:NavigationItem Content="�����б�" Icon="TextBulletListSquareSearch20"
PageType="{x:Type pages:LyrePlayerView}"
Tag="{Binding PlaylistView}" />
<ui:NavigationItem Content="Sheet" Icon="BookOpenMicrophone20"
<ui:NavigationItem Content="����" Icon="BookOpenMicrophone20"
PageType="{x:Type pages:LyrePlayerView}"
Tag="{Binding PianoSheetView}" />
</ui:NavigationStore.Items>
<ui:NavigationStore.Footer>
<ui:NavigationItem Content="Theme" Icon="DarkTheme24" Command="{s:Action ToggleTheme}" />
<ui:NavigationItem Content="Settings" Icon="Settings16"
<ui:NavigationItem Content="����" Icon="DarkTheme24" Command="{s:Action ToggleTheme}" />
<ui:NavigationItem Content="����" Icon="Settings16"
PageType="{x:Type pages:SettingsPageView}"
Tag="{Binding SettingsView}" />
</ui:NavigationStore.Footer>
Expand All @@ -97,7 +98,7 @@
Grid.Row="0" Margin="18"
HorizontalAlignment="Left" VerticalAlignment="Top"
FontSize="24" Navigation="{Binding ElementName=RootNavigation, Mode=OneWay}" />
<Frame Grid.Row="0" x:Name="RootFrame" Visibility="Hidden" />
<Frame x:Name="RootFrame" Visibility="Hidden" />
<modernWpf:AnimatedContentControl Grid.Row="1" Margin="10" s:View.Model="{Binding ActiveItem}" />
</Grid>
</Border>
Expand Down
21 changes: 11 additions & 10 deletions GenshinLyreMidiPlayer.WPF/Views/PianoSheetView.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<UserControl
<?xml version="1.0" encoding="GB2312"?>
<UserControl
x:Class="GenshinLyreMidiPlayer.WPF.Views.PianoSheetView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -28,16 +29,16 @@

<modern:SimpleStackPanel Grid.Row="0">
<TextBlock VerticalAlignment="Center">
Current song:
<Run Text="{Binding PlaylistView.OpenedFile.Title, Mode=OneWay, FallbackValue=Nothing}" />
��ǰ������
<Run Text="{Binding PlaylistView.OpenedFile.Title, Mode=OneWay, FallbackValue=��}" />
</TextBlock>

<modern:SimpleStackPanel Orientation="Horizontal">
<GroupBox Header="Delimiter">
<GroupBox Header="�����">
<TextBox Text="{Binding Delimiter, UpdateSourceTrigger=PropertyChanged}" />
</GroupBox>

<GroupBox Header="Layout">
<GroupBox Header="����">
<ComboBox
ItemsSource="{x:Static core:Keyboard.LayoutNames}"
SelectedItem="{Binding SelectedLayout}"
Expand All @@ -47,11 +48,11 @@
</modern:SimpleStackPanel>

<modern:SimpleStackPanel Orientation="Horizontal">
<GroupBox Header="Split Size">
<GroupBox Header="��ִ�С">
<modern:SimpleStackPanel Orientation="Horizontal">
<modern:NumberBox Header="Bars" Value="{Binding Bars}" />
<modern:NumberBox Header="Beats" Value="{Binding Beats}" />
<modern:NumberBox Header="Shorten every" ToolTip="This will divide the delimiter by this number"
<modern:NumberBox Header="����" Value="{Binding Beats}" />
<modern:NumberBox Header="����" ToolTip="��Ὣ�ָ��������������"
Minimum="1" Value="{Binding Shorten}" />
</modern:SimpleStackPanel>
</GroupBox>
Expand All @@ -61,8 +62,8 @@
<TextBox Grid.Row="1" Text="{Binding Result, Mode=OneWay}" IsReadOnly="True" Margin="0,10" />

<modern:SimpleStackPanel Grid.Row="2" Orientation="Horizontal">
<Button Content="Copy" />
<Button Content="Refresh" Command="{s:Action Update}" />
<Button Content="����" />
<Button Content="ˢ��" Command="{s:Action Update}" />
</modern:SimpleStackPanel>
</Grid>
</UserControl>
9 changes: 5 additions & 4 deletions GenshinLyreMidiPlayer.WPF/Views/PlaylistView.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<UserControl
<?xml version="1.0" encoding="GB2312"?>
<UserControl
x:Class="GenshinLyreMidiPlayer.WPF.Views.PlaylistView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -86,14 +87,14 @@
</Button>

<TextBlock Grid.Column="1" Margin="10,0" VerticalAlignment="Center">
Current song: <Run Text="{Binding OpenedFile.Title, Mode=OneWay, FallbackValue=Open...}" />
Current song: <Run Text="{Binding OpenedFile.Title, Mode=OneWay, FallbackValue=��...}" />
</TextBlock>

<modern:SimpleStackPanel
Grid.Column="2" Orientation="Horizontal"
HorizontalAlignment="Center">
<Button Command="{s:Action RemoveTrack}" Content="Remove" />
<Button Command="{s:Action ClearPlaylist}" Content="Clear Playlist" />
<Button Command="{s:Action RemoveTrack}" Content="�Ƴ�" />
<Button Command="{s:Action ClearPlaylist}" Content="����б�" />
</modern:SimpleStackPanel>
</Grid>

Expand Down
Loading