mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Downgraded i18n used-before-init error to a warning
- Reworking the location of i18n in boot has fixed the main error - However, many of our tests depend on i18n being loaded but don't explicitly call init - There are many ways we could fix this in our tests, but I don't want to spend more time on this now
This commit is contained in:
parent
a2f9204069
commit
f63b4d8dcd
@ -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.`);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user