add german language support (#526)

added german culture support
This commit is contained in:
Ruben
2025-01-06 15:10:12 +01:00
committed by GitHub
parent 8df91270b1
commit f6962657fa
5 changed files with 49 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using System.Windows.Input;
using Avalonia;
@@ -70,37 +71,43 @@ public partial class MainViewModel : ObservableObject
{
Header = "简体中文",
Command = SelectLocaleCommand,
CommandParameter = new System.Globalization.CultureInfo("zh-cn")
CommandParameter = new CultureInfo("zh-cn")
},
new MenuItemViewModel
{
Header = "English",
Command = SelectLocaleCommand,
CommandParameter = new System.Globalization.CultureInfo("en-us")
CommandParameter = new CultureInfo("en-us")
},
new MenuItemViewModel
{
Header = "日本語",
Command = SelectLocaleCommand,
CommandParameter = new System.Globalization.CultureInfo("ja-jp")
CommandParameter = new CultureInfo("ja-jp")
},
new MenuItemViewModel
{
Header = "Українська",
Command = SelectLocaleCommand,
CommandParameter = new System.Globalization.CultureInfo("uk-ua")
CommandParameter = new CultureInfo("uk-ua")
},
new MenuItemViewModel
{
Header = "Русский",
Command = SelectLocaleCommand,
CommandParameter = new System.Globalization.CultureInfo("ru-ru")
CommandParameter = new CultureInfo("ru-ru")
},
new MenuItemViewModel
{
Header = "繁體中文",
Command = SelectLocaleCommand,
CommandParameter = new System.Globalization.CultureInfo("zh-tw")
CommandParameter = new CultureInfo("zh-tw")
},
new MenuItemViewModel
{
Header = "Deutsch",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("de-de")
},
]
}

View File

@@ -0,0 +1,26 @@
<ResourceDictionary x:Class="Semi.Avalonia.Locale.de_de"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">Tag</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">Monat</x:String>
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">Jahr</x:String>
<!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">Stunde</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">Minute</x:String>
<x:String x:Key="STRING_TIMEPICKER_SECOND_TEXT">Sekunde</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">Ausschneiden</x:String>
<x:String x:Key="STRING_MENU_COPY">Kopieren</x:String>
<x:String x:Key="STRING_MENU_PASTE">Einfügen</x:String>
<!-- ManagedFileChooser -->
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Dateiname</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Ausgeblendete Elemente anzeigen</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Abbrechen</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Name</x:String>
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Änderungsdatum</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Typ</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Größe</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">Die Datei {0} existiert bereits. Möchten Sie sie ersetzen?</x:String>
</ResourceDictionary>

View File

@@ -0,0 +1,8 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Locale;
public class de_de : ResourceDictionary
{
}

View File

@@ -16,7 +16,7 @@
<x:String x:Key="STRING_MENU_PASTE">Paste</x:String>
<!-- ManagedFileChooser -->
<x:String x:Key="STRING_CHOOSER_FILE_NAME">File name</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Show hidden flies</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Show hidden files</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Cancel</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Name</x:String>

View File

@@ -24,6 +24,7 @@ public class SemiTheme : Styles
{ new CultureInfo("uk-ua"), new uk_ua() },
{ new CultureInfo("ru-ru"), new ru_ru() },
{ new CultureInfo("zh-tw"), new zh_tw() },
{ new CultureInfo("de-de"), new de_de() },
};
private readonly IServiceProvider? sp;