Fallback to English

This commit is contained in:
2022-06-07 13:00:01 +07:00
parent 6919bb7d90
commit 9b5722b891
+6 -5
View File
@@ -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();