Fix locale loading
This commit is contained in:
@@ -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);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
Reference in New Issue
Block a user