mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
Add language names
This commit is contained in:
parent
dc102da621
commit
c8be108bca
@ -6,48 +6,61 @@ namespace Bloxstrap
|
||||
{
|
||||
internal static class Locale
|
||||
{
|
||||
// TODO: put translated names
|
||||
public static readonly Dictionary<string, string> SupportedLocales = new()
|
||||
{
|
||||
{ "nil", Strings.Enums_Theme_Default }, // /shrug
|
||||
{ "en", "English" },
|
||||
{ "en-US", "English (United States)" },
|
||||
{ "ar", "Arabic" },
|
||||
{ "bn", "Bengali" },
|
||||
{ "bs", "Bosnian" },
|
||||
{ "bg", "Bulgarian" },
|
||||
{ "zh-CN", "Chinese (Simplified)" },
|
||||
{ "zh-TW", "Chinese (Traditional)" },
|
||||
{ "cs", "Czech" },
|
||||
{ "dk", "Danish" },
|
||||
{ "nl", "Dutch" },
|
||||
{ "ar", "العربية" },
|
||||
{ "bn", "বাংলা" },
|
||||
{ "bs", "Босански" },
|
||||
{ "bg", "Български" },
|
||||
{ "zh-CN", "中文(简体)" },
|
||||
{ "zh-TW", "中文(繁體)" },
|
||||
{ "cs", "Čeština" },
|
||||
{ "dk", "Dansk" },
|
||||
{ "nl", "Nederlands" },
|
||||
{ "fl", "Filipino" },
|
||||
{ "fi", "Finnish" },
|
||||
{ "fr", "French" },
|
||||
{ "de", "German" },
|
||||
{ "he", "Hebrew" },
|
||||
{ "hi", "Hindi" },
|
||||
{ "hu", "Hungarian" },
|
||||
{ "id", "Indonesian" },
|
||||
{ "it", "Italian" },
|
||||
{ "ja", "Japanese" },
|
||||
{ "ko", "Korean" },
|
||||
{ "lt", "Lithuanian" },
|
||||
{ "no", "Norwegian" },
|
||||
{ "pl", "Polish" },
|
||||
{ "pt-BR", "Portuguese" },
|
||||
{ "ro", "Romanian" },
|
||||
{ "ru", "Russian" },
|
||||
{ "es", "Spanish" },
|
||||
{ "sv-SE", "Swedish" },
|
||||
{ "th", "Thai" },
|
||||
{ "tr", "Turkish" },
|
||||
{ "uk", "Ukrainian" },
|
||||
{ "vi", "Vietnamese" }
|
||||
{ "fi", "Suomi" },
|
||||
{ "fr", "Français" },
|
||||
{ "de", "Deutsch" },
|
||||
{ "he", "עברית" },
|
||||
{ "hi", "हिन्दी" },
|
||||
{ "hu", "Magyar" },
|
||||
{ "id", "Bahasa Indonesia" },
|
||||
{ "it", "Italiano" },
|
||||
{ "ja", "日本語" },
|
||||
{ "ko", "한국어" },
|
||||
{ "lt", "Lietuvių" },
|
||||
{ "no", "Bokmål" },
|
||||
{ "pl", "Polski" },
|
||||
{ "pt-BR", "Português (Brasil)" },
|
||||
{ "ro", "Română" },
|
||||
{ "ru", "Русский" },
|
||||
{ "es", "Español" },
|
||||
{ "sv-SE", "Svenska" },
|
||||
{ "th", "ภาษาไทย" },
|
||||
{ "tr", "Türkçe" },
|
||||
{ "uk", "Yкраїньска" },
|
||||
{ "vi", "Tiếng Việt" }
|
||||
};
|
||||
|
||||
public static string GetIdentifierFromName(string language) => Locale.SupportedLocales.Where(x => x.Value == language).First().Key;
|
||||
|
||||
public static List<string> GetLanguages()
|
||||
{
|
||||
var languages = new List<string>()
|
||||
{
|
||||
Strings.Enums_Theme_Default,
|
||||
"English",
|
||||
"English (United States)"
|
||||
};
|
||||
|
||||
languages.AddRange(SupportedLocales.Values.Where(x => !languages.Contains(x)).OrderBy(x => x));
|
||||
|
||||
return languages;
|
||||
}
|
||||
|
||||
public static void Set()
|
||||
{
|
||||
string identifier = App.Settings.Prop.Locale;
|
||||
|
@ -15,7 +15,7 @@ namespace Bloxstrap.UI.ViewModels.Dialogs
|
||||
|
||||
public ICommand SetLocaleCommand => new RelayCommand(SetLocale);
|
||||
|
||||
public static List<string> Languages => Locale.SupportedLocales.Values.ToList();
|
||||
public static List<string> Languages => Locale.GetLanguages();
|
||||
|
||||
public string SelectedLanguage { get; set; } = Locale.SupportedLocales[App.Settings.Prop.Locale];
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace Bloxstrap.UI.ViewModels.Menu
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> Languages => Locale.SupportedLocales.Values.ToList();
|
||||
public static List<string> Languages => Locale.GetLanguages();
|
||||
|
||||
public string SelectedLanguage
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user