mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Move SystemLanguageCode to constant
This commit is contained in:
parent
0ae3cfcdd6
commit
3ccd8b42ae
2 changed files with 5 additions and 4 deletions
|
|
@ -18,7 +18,6 @@ namespace Flow.Launcher.Core.Resource
|
|||
{
|
||||
public Settings Settings { get; set; }
|
||||
private const string Folder = "Languages";
|
||||
private const string SystemLanguageCode = "System";
|
||||
private const string DefaultLanguageCode = "en";
|
||||
private const string DefaultFile = "en.xaml";
|
||||
private const string Extension = ".xaml";
|
||||
|
|
@ -73,7 +72,7 @@ namespace Flow.Launcher.Core.Resource
|
|||
|
||||
// Get actual language if language code is system
|
||||
var isSystem = false;
|
||||
if (languageCode == SystemLanguageCode)
|
||||
if (languageCode == Constant.SystemLanguageCode)
|
||||
{
|
||||
languageCode = GetSystemLanguageCode();
|
||||
isSystem = true;
|
||||
|
|
@ -114,7 +113,7 @@ namespace Flow.Launcher.Core.Resource
|
|||
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture;
|
||||
|
||||
// Raise event after culture is set
|
||||
Settings.Language = isSystem ? SystemLanguageCode : language.LanguageCode;
|
||||
Settings.Language = isSystem ? Constant.SystemLanguageCode : language.LanguageCode;
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
UpdatePluginMetadataTranslations();
|
||||
|
|
@ -179,7 +178,7 @@ namespace Flow.Launcher.Core.Resource
|
|||
public List<Language> LoadAvailableLanguages()
|
||||
{
|
||||
var list = AvailableLanguages.GetAvailableLanguages();
|
||||
list.Insert(0, new Language(SystemLanguageCode, AvailableLanguages.GetSystemTranslation(GetSystemLanguageCode())));
|
||||
list.Insert(0, new Language(Constant.SystemLanguageCode, AvailableLanguages.GetSystemTranslation(GetSystemLanguageCode())));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,5 +52,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
public const string SponsorPage = "https://github.com/sponsors/Flow-Launcher";
|
||||
public const string GitHub = "https://github.com/Flow-Launcher/Flow.Launcher";
|
||||
public const string Docs = "https://flowlauncher.com/docs";
|
||||
|
||||
public const string SystemLanguageCode = "System";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue