Fix wrong initial language selection
This commit is contained in:
1 parent
45d539892a
commit
c070f8d078
3 files changed
+14
-6
No files matched your search
@@ -134,7 +134,7 @@ namespace Vocaluxe.Base
|
||||
public static ETimerMode TimerMode = ETimerMode.TR_CONFIG_TIMERMODE_REMAINING;
|
||||
public static int NumPlayer = 2;
|
||||
public static EOffOn Tabs = EOffOn.TR_CONFIG_OFF;
|
||||
public static string Language = "English";
|
||||
public static string Language = CSettings.FallbackLanguage;
|
||||
public static ELyricsPosition LyricsPosition = ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTTOM;
|
||||
public static readonly string[] Players = new string[CSettings.MaxNumPlayer];
|
||||
|
||||
@@ -302,9 +302,11 @@ namespace Vocaluxe.Base
|
||||
|
||||
bool langExists = CLanguage.SetLanguage(Language);
|
||||
|
||||
//TODO: What should we do, if English not exists?
|
||||
if (langExists == false)
|
||||
Language = "English";
|
||||
{
|
||||
Language = CSettings.FallbackLanguage;
|
||||
CLanguage.SetLanguage(Language);
|
||||
}
|
||||
|
||||
//Read players from config
|
||||
for (i = 1; i <= CSettings.MaxNumPlayer; i++)
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Vocaluxe.Base
|
||||
static class CLanguage
|
||||
{
|
||||
private static List<SLanguage> _Languages;
|
||||
private static int _CurrentLanguage;
|
||||
private static int _CurrentLanguage = -1;
|
||||
private static int _FallbackLanguage;
|
||||
|
||||
public static int LanguageId
|
||||
@@ -69,7 +69,7 @@ namespace Vocaluxe.Base
|
||||
return languages;
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
public static bool Init()
|
||||
{
|
||||
_Languages = new List<SLanguage>();
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
foreach (string file in files)
|
||||
_LoadLanguageFile(file);
|
||||
return _CurrentLanguage >= 0 && _FallbackLanguage >= 0;
|
||||
}
|
||||
|
||||
public static bool SetLanguage(string language)
|
||||
@@ -225,7 +226,11 @@ namespace Vocaluxe.Base
|
||||
lang.Name = value;
|
||||
|
||||
if (lang.Name == CSettings.FallbackLanguage)
|
||||
{
|
||||
_FallbackLanguage = _Languages.Count;
|
||||
if (_CurrentLanguage < 0)
|
||||
_CurrentLanguage = _FallbackLanguage;
|
||||
}
|
||||
|
||||
lang.PartyModeTexts = new List<SPartyLanguage>();
|
||||
|
||||
|
||||
+2
-1
@@ -91,7 +91,8 @@ namespace Vocaluxe
|
||||
|
||||
// Init Language
|
||||
CLog.StartBenchmark("Init Language");
|
||||
CLanguage.Init();
|
||||
if (!CLanguage.Init())
|
||||
throw new CLoadingException("Language");
|
||||
CLog.StopBenchmark("Init Language");
|
||||
|
||||
Application.DoEvents();
|
||||
|
||||
Reference in new issue
Block a user