Fix bug with default language selection

This commit is contained in:
pizzaboxer 2024-07-02 11:09:15 +04:00
parent ca0c1d55cd
commit f751e134eb
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -51,7 +51,7 @@ namespace Bloxstrap
{ "vi", "Tiếng Việt" }
};
public static string GetIdentifierFromName(string language) => Locale.SupportedLocales.Where(x => x.Value == language).First().Key;
public static string GetIdentifierFromName(string language) => SupportedLocales.FirstOrDefault(x => x.Value == language).Key ?? "nil";
public static List<string> GetLanguages()
{