diff --git a/core/frontend/services/theme-engine/i18n/i18n.js b/core/frontend/services/theme-engine/i18n/i18n.js index 9b19402ba3..20aab9d7f8 100644 --- a/core/frontend/services/theme-engine/i18n/i18n.js +++ b/core/frontend/services/theme-engine/i18n/i18n.js @@ -49,6 +49,10 @@ class ThemeI18n extends i18n.I18n { return [this.basePath, this._activetheme, 'locales']; } + _handleUninitialisedError(key) { + throw new errors.IncorrectUsageError({message: `Theme translation was used before it was initialised with key ${key}`}); + } + _handleFallbackToDefault() { this._logging.warn(`Theme translations falling back to locales/${this.defaultLocale()}.json.`); } diff --git a/core/shared/i18n/i18n.js b/core/shared/i18n/i18n.js index 73339d2324..bab9f01fd2 100644 --- a/core/shared/i18n/i18n.js +++ b/core/shared/i18n/i18n.js @@ -255,7 +255,8 @@ class I18n { } _handleUninitialisedError(key) { - throw new errors.IncorrectUsageError({message: `i18n was used before it was initialised with key ${key}`}); + this._logging.warn(`i18n was used before it was initialised with key ${key}`); + this.init(); } _handleFormatError(err) {