From b15a051ee34811aa3390ec2f473b3ea037c9bf1a Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 2 Jun 2022 09:48:02 +0200 Subject: [PATCH] Show an error when using a translation key that does not exist --- application/views/components/js_lang_script.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/views/components/js_lang_script.php b/application/views/components/js_lang_script.php index 143f03f6..80a821f2 100644 --- a/application/views/components/js_lang_script.php +++ b/application/views/components/js_lang_script.php @@ -7,7 +7,12 @@ return lang; } - return lang[key] || undefined; + if (!lang[key]) { + console.error(`Cannot find translation for requested key: "${key}"`); + return key; + } + + return lang[key]; }; })();