Skip to content

Commit 0adfeff

Browse files
committed
minor cleanup
1 parent f3346ab commit 0adfeff

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ModAssistant/Classes/Languages.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
namespace ModAssistant
1010
{
11-
class Languages
11+
internal class Languages
1212
{
1313
public static string LoadedLanguage { get; private set; }
14-
public static List<CultureInfo> LoadedLanguages { get => availableCultures.ToList(); }
14+
public static List<CultureInfo> LoadedLanguages => availableCultures.ToList();
1515
public static bool FirstRun = true;
1616
private static readonly string[] availableLanguageCodes = { "de", "en", "es", "fr", "it", "ko", "nb", "nl", "pl", "ru", "sv", "th", "zh" };
1717
private static IEnumerable<CultureInfo> availableCultures;
@@ -29,9 +29,10 @@ public static void LoadLanguages()
2929
// If no language code was saved, load system language
3030
if (!LoadLanguage(CultureInfo.CurrentUICulture.Name))
3131
{
32-
LoadLanguage("en");
32+
_ = LoadLanguage("en");
3333
}
3434
}
35+
3536
UpdateUI(LoadedLanguage);
3637
}
3738

@@ -54,7 +55,11 @@ public static ResourceDictionary LanguagesDict
5455

5556
public static bool LoadLanguage(string languageCode)
5657
{
57-
if (string.IsNullOrEmpty(languageCode)) return false;
58+
if (string.IsNullOrEmpty(languageCode))
59+
{
60+
return false;
61+
}
62+
5863
try
5964
{
6065
LanguagesDict.Source = new Uri($"Localisation/{languageCode}.xaml", UriKind.Relative);
@@ -67,6 +72,7 @@ public static bool LoadLanguage(string languageCode)
6772
{
6873
return LoadLanguage(languageCode.Split('-').First());
6974
}
75+
7076
return false;
7177
}
7278
}

0 commit comments

Comments
 (0)