From 2fb02998de0a3d172d1db2621a51eff2aec7624c Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:28:51 -0500 Subject: [PATCH] Show error when locale string is missing --- scripts/server/locale.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/server/locale.js b/scripts/server/locale.js index b876212f..b353a834 100644 --- a/scripts/server/locale.js +++ b/scripts/server/locale.js @@ -16,8 +16,10 @@ function initLocaleScript() { function getLocaleString(client, stringName, ...args) { let tempString = getRawLocaleString(stringName, getPlayerData(client).locale); - if(tempString == "") { + if(tempString == "" || tempString == null || typeof tempString == "undefined") { + logToConsole(LOG_WARN, `[VRR.Locale] Locale string missing for ${stringName} on language ${getLocaleData(getPlayerData(client).locale).englishName}`); submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`); + return ""; } for(let i = 1; i <= args.length; i++) { @@ -31,7 +33,8 @@ function getLocaleString(client, stringName, ...args) { function getLanguageLocaleString(localeId, stringName, ...args) { let tempString = getRawLocaleString(stringName, localeId); - if(tempString == "") { + if(tempString == "" || tempString == null || typeof tempString == "undefined") { + logToConsole(LOG_WARN, `[VRR.Locale] Locale string missing for ${stringName} on language ${getLocaleData(getPlayerData(client).locale).englishName}`); submitBugReport(client, `(AUTOMATED REPORT) Locale string "${stringName}" is missing for "${getPlayerLocaleName(client)}"`); }