Added spanish locale (#560)

* Added spanish locale

* fixed resource directory name

* Added spanish locale to demo

* using spanish local name
This commit is contained in:
Vicente Penades
2025-03-11 16:11:14 +01:00
committed by GitHub
parent ffbd8efef7
commit 8022a80f0e
4 changed files with 42 additions and 0 deletions

View File

@@ -114,6 +114,12 @@ public partial class MainViewModel : ObservableObject
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("de-de")
},
new MenuItemViewModel
{
Header = "Español",
Command = SelectLocaleCommand,
CommandParameter = new CultureInfo("es-es")
},
]
}
];

View File

@@ -0,0 +1,27 @@
<ResourceDictionary
x:Class="Semi.Avalonia.Locale.es_es"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">dia</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">mes</x:String>
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">año</x:String>
<!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">hora</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">minuto</x:String>
<x:String x:Key="STRING_TIMEPICKER_SECOND_TEXT">segundo</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">Cortar</x:String>
<x:String x:Key="STRING_MENU_COPY">Copiar</x:String>
<x:String x:Key="STRING_MENU_PASTE">Pegar</x:String>
<!-- ManagedFileChooser -->
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Nombre de fichero</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Mostrar ficheros ocultos</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Cancelar</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Nombre</x:String>
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Fecha modificada</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Tipo</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Tamaño</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">{0} ya existe. Quieres reemplazarlo?</x:String>
</ResourceDictionary>

View File

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

View File

@@ -20,6 +20,7 @@ public class SemiTheme : Styles
{ new CultureInfo("ru-ru"), new ru_ru() },
{ new CultureInfo("zh-tw"), new zh_tw() },
{ new CultureInfo("de-de"), new de_de() },
{ new CultureInfo("es-es"), new es_es() },
};
private static readonly ResourceDictionary _defaultResource = new zh_cn();