From e5cc1098950c19f27cbbacc658e100a24c99cf91 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 12 Jan 2022 23:40:25 +0200 Subject: [PATCH] make sure properties exist --- src/structure/client/LocaleLoader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structure/client/LocaleLoader.js b/src/structure/client/LocaleLoader.js index e9f51da..ef941a1 100644 --- a/src/structure/client/LocaleLoader.js +++ b/src/structure/client/LocaleLoader.js @@ -25,8 +25,9 @@ class LocaleLoader { format(language, index, parameters = {}, code = false) { + if (!this.languages[language]) return `< Missing Locale: ${language} >`; let string = this.languages[language][index]; - if(!string) return `< Missing Locale: ${language}.${index} >`; + if(!string) return `< Missing Locale Index: ${language}.${index} >`; for(const [ parameter, value ] of Object.entries(parameters)) { string = string.replace(new RegExp(Util.escapeRegex(`{${parameter.toLowerCase()}}`), 'giu'), value);