mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Fallback to English
This commit is contained in:
@@ -10,19 +10,20 @@ class Locale {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public init(): void {
|
public init(): void {
|
||||||
Logger.log('info', 'Loaded locales: ' + this.getLocaleProvider("en").getLocales().join(', '));
|
Logger.log('info', 'Loaded locales: ' + this.getLocaleProvider('en').getLocales().join(', '));
|
||||||
}
|
}
|
||||||
|
|
||||||
public getLocaleProvider(locale: string) {
|
public getLocaleProvider(locale: string) {
|
||||||
const i18n = new I18n();
|
const i18n = new I18n();
|
||||||
i18n.configure({
|
i18n.configure({
|
||||||
directory: this.localePath,
|
directory: this.localePath,
|
||||||
objectNotation: true
|
objectNotation: true,
|
||||||
})
|
defaultLocale: 'en',
|
||||||
|
retryInDefaultLocale: true
|
||||||
|
});
|
||||||
i18n.setLocale(locale);
|
i18n.setLocale(locale);
|
||||||
return i18n;
|
return i18n;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Locale();
|
export default new Locale();
|
||||||
Reference in New Issue
Block a user