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>
This commit is contained in:
King
2025-06-14 06:08:24 +01:00
committed by GitHub
parent ffa2f04842
commit 4522b48f22
4 changed files with 39 additions and 3 deletions

View File

@@ -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<MenuItemViewModel>? Items { get; set; }
}
}

View File

@@ -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;
public class zh_tw : ResourceDictionary;

View File

@@ -0,0 +1,27 @@
<ResourceDictionary
x:Class="Semi.Avalonia.Locale.fr_fr"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- DatePicker -->
<x:String x:Key="STRING_DATEPICKER_DAY_TEXT">Jour</x:String>
<x:String x:Key="STRING_DATEPICKER_MONTH_TEXT">Mois</x:String>
<x:String x:Key="STRING_DATEPICKER_YEAR_TEXT">Année</x:String>
<!-- TimePicker -->
<x:String x:Key="STRING_TIMEPICKER_HOUR_TEXT">Heure</x:String>
<x:String x:Key="STRING_TIMEPICKER_MINUTE_TEXT">Minute</x:String>
<x:String x:Key="STRING_TIMEPICKER_SECOND_TEXT">Seconde</x:String>
<!-- TextBox/SelectableTextBox flyout -->
<x:String x:Key="STRING_MENU_CUT">Couper</x:String>
<x:String x:Key="STRING_MENU_COPY">Copier</x:String>
<x:String x:Key="STRING_MENU_PASTE">Coller</x:String>
<!-- ManagedFileChooser -->
<x:String x:Key="STRING_CHOOSER_FILE_NAME">Nom du fichier</x:String>
<x:String x:Key="STRING_CHOOSER_SHOW_HIDDEN_FILES">Afficher les fichiers cachés</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_OK">OK</x:String>
<x:String x:Key="STRING_CHOOSER_DIALOG_CANCEL">Annuler</x:String>
<x:String x:Key="STRING_CHOOSER_NAME_COLUMN">Nom</x:String>
<x:String x:Key="STRING_CHOOSER_DATEMODIFIED_COLUMN">Date de modification</x:String>
<x:String x:Key="STRING_CHOOSER_TYPE_COLUMN">Type</x:String>
<x:String x:Key="STRING_CHOOSER_SIZE_COLUMN">Taille</x:String>
<x:String x:Key="STRING_CHOOSER_PROMPT_FILE_ALREADY_EXISTS">{0} existe déjà. Voulez-vous le remplacer ?</x:String>
</ResourceDictionary>

View File

@@ -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;
}
}
}
}