mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
better hack
This commit is contained in:
parent
9d308ee87b
commit
0e2c40644f
@ -43,8 +43,21 @@ public static class QSBLocalization
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// just use the system language until the profile is loaded and does SetLanguage
|
||||||
// hack to stop things from breaking
|
// hack to stop things from breaking
|
||||||
Current = _translations[0];
|
{
|
||||||
|
var language = TextTranslation.Get().GetSystemLanguage();
|
||||||
|
DebugLog.DebugWrite($"Language changed to {language}");
|
||||||
|
var newTranslation = _translations.FirstOrDefault(x => x.Language == language);
|
||||||
|
|
||||||
|
if (newTranslation == default)
|
||||||
|
{
|
||||||
|
DebugLog.ToConsole($"Error - Could not find translation for language {language}! Defaulting to English.");
|
||||||
|
newTranslation = _translations.First(x => x.Language == TextTranslation.Language.ENGLISH);
|
||||||
|
}
|
||||||
|
|
||||||
|
Current = newTranslation;
|
||||||
|
}
|
||||||
|
|
||||||
TextTranslation.Get().OnLanguageChanged += OnLanguageChanged;
|
TextTranslation.Get().OnLanguageChanged += OnLanguageChanged;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user