From c6a2b4e429006fad555528484a4abeb5509a1a7f Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Thu, 27 Feb 2025 20:48:16 +0100 Subject: [PATCH] Trace-log stacktrace of translations without key --- public/scripts/i18n.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/scripts/i18n.js b/public/scripts/i18n.js index f47cc9d77..c2a2fdf83 100644 --- a/public/scripts/i18n.js +++ b/public/scripts/i18n.js @@ -100,6 +100,10 @@ export function t(strings, ...values) { */ export function translate(text, key = null) { const translationKey = key || text; + if (translationKey === null || translationKey === undefined) { + console.trace('WARN: No translation key provided'); + return ''; + } if (trackMissingDynamicTranslate && localeData && !Object.hasOwn(localeData, translationKey) && !trackMissingDynamicTranslate.includes(translationKey)) { trackMissingDynamicTranslate.push(translationKey); }