Skip to content

Commit f4b3310

Browse files
committed
Fix crash - when windows culture code not exist as language
1 parent 1aacad0 commit f4b3310

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Source/NETworkManager/Models/Settings/LocalizationManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public static void Load()
3636
// If it's empty... detect the windows language
3737
if (string.IsNullOrEmpty(cultureCode))
3838
cultureCode = CultureInfo.CurrentCulture.Name;
39-
39+
4040
// Get the language from the list
41-
LocalizationInfo info = List.Where(x => x.Code == cultureCode).First();
41+
LocalizationInfo info = List.Where(x => x.Code == cultureCode).FirstOrDefault();
4242

4343
// If it's not in the list, get the first one
4444
if (info == null)
@@ -55,7 +55,7 @@ public static void Load()
5555
Culture = new CultureInfo(info.Code);
5656
}
5757
}
58-
58+
5959
private static ResourceDictionary _resourceDictionaryLocalization;
6060

6161
public static void Change(LocalizationInfo info)

Source/NETworkManager/Models/Settings/SettingsInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public double Appearance_Opacity
175175
}
176176

177177
// Localization
178-
private string _localization_CultureCode = "en-US";
178+
private string _localization_CultureCode;
179179
public string Localization_CultureCode
180180
{
181181
get { return _localization_CultureCode; }

0 commit comments

Comments
 (0)