Add French local to the resources (#702)

* Create fr-fr.axaml

Create the resources for french local

* Create fr-fr.axaml.cs code behind for french local

* Add French as a local resource in index file

* Fix duplicate keys

* Update src/Ursa.Themes.Semi/Locale/fr-fr.axaml to AI suggestions

Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>

---------

Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
This commit is contained in:
King
2025-06-14 06:23:08 +01:00
committed by GitHub
parent eb20d8eaec
commit ef668079b3
3 changed files with 37 additions and 2 deletions

View File

@@ -15,7 +15,8 @@ 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("en-US"), new en_us() },
{ new CultureInfo("fr-FR"), new fr_fr() },
};
private static readonly ResourceDictionary _defaultResource = new zh_cn();
@@ -94,4 +95,4 @@ public class SemiTheme : Styles
if (!_localeToResource.TryGetValue(culture, out var resources)) return;
foreach (var kv in resources) element.Resources[kv.Key] = kv.Value;
}
}
}

View File

@@ -0,0 +1,21 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
x:Class="Ursa.Themes.Semi.Locale.fr_fr"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:String x:Key="STRING_MENU_BRING_TO_FRONT">Mettre au premier plan</x:String>
<x:String x:Key="STRING_MENU_BRING_FORWARD">Avancer</x:String>
<x:String x:Key="STRING_MENU_SEND_BACKWARD">Reculer</x:String>
<x:String x:Key="STRING_MENU_SEND_TO_BACK">Envoyer à l'arrière</x:String>
<x:String x:Key="STRING_MENU_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_MENU_DIALOG_CANCEL">Annuler</x:String>
<x:String x:Key="STRING_MENU_DIALOG_YES">Oui</x:String>
<x:String x:Key="STRING_MENU_DIALOG_NO">Non</x:String>
<x:String x:Key="STRING_MENU_DIALOG_CLOSE">Fermer</x:String>
<x:String x:Key="STRING_PAGINATION_JUMP_TO">Aller à la page</x:String>
<x:String x:Key="STRING_PAGINATION_PAGE"> </x:String>
<x:String x:Key="STRING_THEME_TOGGLE_DARK">Sombre</x:String>
<x:String x:Key="STRING_THEME_TOGGLE_LIGHT">Clair</x:String>
<x:String x:Key="STRING_THEME_TOGGLE_SYSTEM">Système</x:String>
<x:String x:Key="STRING_DATE_TIME_CONFIRM">Confirmer</x:String>
<x:String x:Key="STRING_DATE_TIME_START_TIME">Heure de début</x:String>
<x:String x:Key="STRING_DATE_TIME_END_TIME">Heure de fin</x:String>
</ResourceDictionary>

View File

@@ -0,0 +1,13 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Ursa.Themes.Semi.Locale;
public class fr_fr: ResourceDictionary
{
public fr_fr()
{
AvaloniaXamlLoader.Load(this);
this["STRING_PAGINATION_PAGE"] = string.Empty;
}
}