From ef668079b386d9eec5e9667bdbf3e4315e9ec7f5 Mon Sep 17 00:00:00 2001 From: King Date: Sat, 14 Jun 2025 06:23:08 +0100 Subject: [PATCH] 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> --- src/Ursa.Themes.Semi/Index.axaml.cs | 5 +++-- src/Ursa.Themes.Semi/Locale/fr-fr.axaml | 21 +++++++++++++++++++++ src/Ursa.Themes.Semi/Locale/fr-fr.axaml.cs | 13 +++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/Ursa.Themes.Semi/Locale/fr-fr.axaml create mode 100644 src/Ursa.Themes.Semi/Locale/fr-fr.axaml.cs diff --git a/src/Ursa.Themes.Semi/Index.axaml.cs b/src/Ursa.Themes.Semi/Index.axaml.cs index efa2038..aad0df8 100644 --- a/src/Ursa.Themes.Semi/Index.axaml.cs +++ b/src/Ursa.Themes.Semi/Index.axaml.cs @@ -15,7 +15,8 @@ public class SemiTheme : Styles private static readonly Dictionary _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; } -} \ No newline at end of file +} diff --git a/src/Ursa.Themes.Semi/Locale/fr-fr.axaml b/src/Ursa.Themes.Semi/Locale/fr-fr.axaml new file mode 100644 index 0000000..0877df4 --- /dev/null +++ b/src/Ursa.Themes.Semi/Locale/fr-fr.axaml @@ -0,0 +1,21 @@ + + Mettre au premier plan + Avancer + Reculer + Envoyer à l'arrière + OK + Annuler + Oui + Non + Fermer + Aller à la page + + Sombre + Clair + Système + Confirmer + Heure de début + Heure de fin + diff --git a/src/Ursa.Themes.Semi/Locale/fr-fr.axaml.cs b/src/Ursa.Themes.Semi/Locale/fr-fr.axaml.cs new file mode 100644 index 0000000..1f3efb9 --- /dev/null +++ b/src/Ursa.Themes.Semi/Locale/fr-fr.axaml.cs @@ -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; + } +}