diff --git a/packages/common/i18next.js b/packages/common/i18next.js index 2ece798cf7d61423a3a995d6ebe8c2a16e6ef18c..4f3db6956b673873c47ce7b309ed24c223a5cf0b 100644 --- a/packages/common/i18next.js +++ b/packages/common/i18next.js @@ -125,19 +125,16 @@ export function createInstance(languages, lng, fallback, namespace) { i18n.init(options); console.assert(i18n.isInitialized); - // if debug mode is activated, override i18n.t() to print errors if keys are missing - if (window.location.hash.includes('debug')) { - const translate = i18n.t; - const that = i18n; - - i18n.t = function (keys, options) { - if (!that.exists(keys)) { - console.error("Error: Translation key " + keys + " does not exist!"); - } - - return translate(keys, options); - }; - } + // override i18n.t() to print warnings if keys are missing + const translate = i18n.t; + const that = i18n; + i18n.t = function (keys, options) { + if (!that.exists(keys)) { + console.warn("Translation warning: Default key " + keys + " does not exist!"); + } + + return translate(keys, options); + }; return i18n; }