From 4522b48f22a1e9faed3020c037fe091baf90813a Mon Sep 17 00:00:00 2001 From: King Date: Sat, 14 Jun 2025 06:08:24 +0100 Subject: [PATCH] Add French local to the set of languages (#626) * Create fr-fr.axaml Creating the locale resource for French language * Update _index.cs Include french in the index file * Update fr-fr.axaml Fix namespace * Update MainView.axaml.cs Adding French as a demo language * Update demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs Language specific header name Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> * Update src/Semi.Avalonia/Locale/fr-fr.axaml Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> * Update src/Semi.Avalonia/Locale/fr-fr.axaml Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> * Add French to the local collection --------- Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> --- .../Views/MainView.axaml.cs | 8 +++++- src/Semi.Avalonia/Locale/_index.cs | 4 ++- src/Semi.Avalonia/Locale/fr-fr.axaml | 27 +++++++++++++++++++ src/Semi.Avalonia/SemiTheme.axaml.cs | 3 ++- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/Semi.Avalonia/Locale/fr-fr.axaml diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs index 60c7e8f..ef92af6 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml.cs @@ -126,6 +126,12 @@ public partial class MainViewModel : ObservableObject Command = SelectLocaleCommand, CommandParameter = new CultureInfo("pl-pl") }, + new MenuItemViewModel + { + Header = "Français", + Command = SelectLocaleCommand, + CommandParameter = new CultureInfo("fr-fr") + }, ] } ]; @@ -191,4 +197,4 @@ public class MenuItemViewModel public ICommand? Command { get; set; } public object? CommandParameter { get; set; } public IList? Items { get; set; } -} \ No newline at end of file +} diff --git a/src/Semi.Avalonia/Locale/_index.cs b/src/Semi.Avalonia/Locale/_index.cs index f024267..4d3ac06 100644 --- a/src/Semi.Avalonia/Locale/_index.cs +++ b/src/Semi.Avalonia/Locale/_index.cs @@ -8,6 +8,8 @@ public class en_us : ResourceDictionary; public class es_es : ResourceDictionary; +public class fr_fr : ResourceDictionary; + public class ja_jp : ResourceDictionary; public class pl_pl : ResourceDictionary; @@ -18,4 +20,4 @@ public class uk_ua : ResourceDictionary; public class zh_cn : ResourceDictionary; -public class zh_tw : ResourceDictionary; \ No newline at end of file +public class zh_tw : ResourceDictionary; diff --git a/src/Semi.Avalonia/Locale/fr-fr.axaml b/src/Semi.Avalonia/Locale/fr-fr.axaml new file mode 100644 index 0000000..5a3b207 --- /dev/null +++ b/src/Semi.Avalonia/Locale/fr-fr.axaml @@ -0,0 +1,27 @@ + + + Jour + Mois + Année + + Heure + Minute + Seconde + + Couper + Copier + Coller + + Nom du fichier + Afficher les fichiers cachés + OK + Annuler + Nom + Date de modification + Type + Taille + {0} existe déjà. Voulez-vous le remplacer ? + diff --git a/src/Semi.Avalonia/SemiTheme.axaml.cs b/src/Semi.Avalonia/SemiTheme.axaml.cs index 416a4e5..cf7eee9 100644 --- a/src/Semi.Avalonia/SemiTheme.axaml.cs +++ b/src/Semi.Avalonia/SemiTheme.axaml.cs @@ -22,6 +22,7 @@ public class SemiTheme : Styles { new CultureInfo("de-de"), new de_de() }, { new CultureInfo("es-es"), new es_es() }, { new CultureInfo("pl-pl"), new pl_pl() }, + { new CultureInfo("fr-fr"), new fr_fr() }, }; private static readonly ResourceDictionary _defaultResource = new zh_cn(); @@ -106,4 +107,4 @@ public class SemiTheme : Styles element.Resources[kv.Key] = kv.Value; } } -} \ No newline at end of file +}