Fix client locale utils

This commit is contained in:
Vortrex
2022-04-06 16:36:03 -05:00
parent 672ee7e338
commit e7eb9608ea

View File

@@ -8,6 +8,10 @@
// =========================================================================== // ===========================================================================
function getLocaleString(stringName, ...args) { function getLocaleString(stringName, ...args) {
if(typeof getServerData().localeStrings[stringName] == undefined) {
return "";
}
let tempString = getServerData().localeStrings[stringName]; let tempString = getServerData().localeStrings[stringName];
for(let i = 1; i <= args.length; i++) { for(let i = 1; i <= args.length; i++) {
@@ -20,6 +24,7 @@ function getLocaleString(stringName, ...args) {
// =========================================================================== // ===========================================================================
function receiveLocaleStringFromServer(stringName, stringValue) { function receiveLocaleStringFromServer(stringName, stringValue) {
logToConsole(LOG_INFO, `[VRR.Locale]: Received locale string "${stringName}" from server (${stringValue})`);
getServerData().localeStrings[stringName] = stringValue; getServerData().localeStrings[stringName] = stringValue;
} }