Skip to content

Commit 0e700cd

Browse files
committed
rename GetSystemLanguageCode method + add comment
1 parent 66b3f5a commit 0e700cd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Flow.Launcher.Core/Resource/Internationalization.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Internationalization
2828
public Internationalization()
2929
{
3030
AddFlowLauncherLanguageDirectory();
31-
SystemLanguageCode = GetSystemLanguageCode();
31+
SystemLanguageCode = GetSystemLanguageCodeAtStartup();
3232
}
3333

3434
private void AddFlowLauncherLanguageDirectory()
@@ -37,11 +37,13 @@ private void AddFlowLauncherLanguageDirectory()
3737
_languageDirectories.Add(directory);
3838
}
3939

40-
private static string GetSystemLanguageCode()
40+
private static string GetSystemLanguageCodeAtStartup()
4141
{
4242
var availableLanguages = AvailableLanguages.GetAvailableLanguages();
4343

44-
// Retrieve the language identifiers for the current culture
44+
// Retrieve the language identifiers for the current culture.
45+
// ChangeLanguage method overrides the CultureInfo.CurrentCulture, so this needs to
46+
// be called at startup in order to get the correct lang code of system.
4547
var currentCulture = CultureInfo.CurrentCulture;
4648
var twoLetterCode = currentCulture.TwoLetterISOLanguageName;
4749
var threeLetterCode = currentCulture.ThreeLetterISOLanguageName;

0 commit comments

Comments
 (0)