Fix locale loading

This commit is contained in:
Vortrex
2022-07-30 08:15:20 -05:00
parent 0fd711dc0b
commit a1e9ad0b42
2 changed files with 6 additions and 7 deletions

View File

@@ -69,10 +69,6 @@ function initGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] All GUI created successfully!`); logToConsole(LOG_DEBUG, `[VRR.GUI] All GUI created successfully!`);
loadLocaleConfig(); loadLocaleConfig();
loadAllLocaleStrings();
resetGUIStrings();
resetLocaleChooserOptions();
sendNetworkEventToServer("agrp.guiReady", true); sendNetworkEventToServer("agrp.guiReady", true);
}; };

View File

@@ -37,6 +37,9 @@ function getAvailableLocaleOptions() {
function loadLocaleConfig() { function loadLocaleConfig() {
let configFile = loadTextFile("config/client/locale.json"); let configFile = loadTextFile("config/client/locale.json");
getServerData().localeOptions = JSON.parse(configFile); getServerData().localeOptions = JSON.parse(configFile);
resetLocaleChooserOptions();
loadAllLocaleStrings();
} }
// =========================================================================== // ===========================================================================
@@ -50,6 +53,8 @@ function loadAllLocaleStrings() {
getServerData().localeStrings[i] = localeData; getServerData().localeStrings[i] = localeData;
} }
resetGUIStrings();
} }
// =========================================================================== // ===========================================================================
@@ -58,6 +63,4 @@ function setLocale(tempLocaleId) {
logToConsole(LOG_DEBUG, `[VRR.Locale] Setting locale to ${tempLocaleId} (${getServerData().localeOptions[tempLocaleId].englishName})`); logToConsole(LOG_DEBUG, `[VRR.Locale] Setting locale to ${tempLocaleId} (${getServerData().localeOptions[tempLocaleId].englishName})`);
localLocaleId = tempLocaleId; localLocaleId = tempLocaleId;
resetGUIStrings(); resetGUIStrings();
} }
// ===========================================================================