1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00
Files
web/src/services/i18n.service.ts
2018-08-06 08:58:50 -04:00

18 lines
753 B
TypeScript

import { I18nService as BaseI18nService } from 'jslib/services/i18n.service';
export class I18nService extends BaseI18nService {
constructor(systemLanguage: string, localesDirectory: string) {
super(systemLanguage || 'en-US', localesDirectory, async (formattedLocale: string) => {
const filePath = this.localesDirectory + '/' + formattedLocale + '/messages.json?cache=' +
process.env.CACHE_TAG;
const localesResult = await fetch(filePath);
const locales = await localesResult.json();
return locales;
});
this.supportedTranslationLocales = [
'en', 'cs', 'da', 'de', 'es', 'fr', 'nb', 'pt-PT', 'pt-BR', 'ru', 'sk', 'sv', 'zh-CN',
];
}
}