RU locale
This commit is contained in:
parent
fae4a32507
commit
a28cbf5ac2
24
src/Semi.Avalonia/Locale/ru-ru.axaml
Normal file
24
src/Semi.Avalonia/Locale/ru-ru.axaml
Normal file
@ -0,0 +1,24 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Semi.Avalonia.Locale.ru_ru"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- DatePicker -->
|
||||
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">день</x:String>
|
||||
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">месяц</x:String>
|
||||
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">год</x:String>
|
||||
<!-- TimePicker -->
|
||||
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">часы</x:String>
|
||||
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">минуты</x:String>
|
||||
<!-- TextBox/SelectableTextBox flyout -->
|
||||
<x:String x:Key="STRING_MENU_CUT">Вырезать</x:String>
|
||||
<x:String x:Key="STRING_MENU_COPY">Копировать</x:String>
|
||||
<x:String x:Key="STRING_MENU_PASTE">Вставить</x:String>
|
||||
<!-- ManagedFileChooser -->
|
||||
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Имя файла</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_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">Имя</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Дата изменения</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Тип</x:String>
|
||||
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Размер</x:String>
|
||||
</ResourceDictionary>
|
8
src/Semi.Avalonia/Locale/ru-ru.axaml.cs
Normal file
8
src/Semi.Avalonia/Locale/ru-ru.axaml.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Semi.Avalonia.Locale;
|
||||
|
||||
public class ru_ru : ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
@ -8,14 +8,15 @@ using Semi.Avalonia.Locale;
|
||||
|
||||
namespace Semi.Avalonia;
|
||||
|
||||
public class SemiTheme: Styles
|
||||
public class SemiTheme : Styles
|
||||
{
|
||||
private static readonly Dictionary<CultureInfo, ResourceDictionary> _localeToResource = new()
|
||||
{
|
||||
{ new CultureInfo("zh-cn"), new zh_cn() },
|
||||
{ new CultureInfo("en-us"), new en_us() },
|
||||
{ new CultureInfo("ru-ru"), new ru_ru() },
|
||||
};
|
||||
|
||||
|
||||
private readonly IServiceProvider? sp;
|
||||
public SemiTheme(IServiceProvider? provider = null)
|
||||
{
|
||||
@ -28,17 +29,17 @@ public class SemiTheme: Styles
|
||||
{
|
||||
get => _locale;
|
||||
set
|
||||
{
|
||||
{
|
||||
_locale = value;
|
||||
var resource = TryGetLocaleResource(value);
|
||||
if(resource is null) return;
|
||||
if (resource is null) return;
|
||||
foreach (var kv in resource)
|
||||
{
|
||||
this.Resources.Add(kv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static ResourceDictionary? TryGetLocaleResource(CultureInfo? locale)
|
||||
{
|
||||
if (locale is null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user