1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00:00

load loacles for safari app

This commit is contained in:
Kyle Spearrin
2019-08-15 13:22:26 -04:00
parent 9ee25156bd
commit e5e04b8fa9
3 changed files with 13 additions and 14 deletions

View File

@@ -7,8 +7,8 @@ export default class I18nService extends BaseI18nService {
constructor(systemLanguage: string) {
super(systemLanguage, BrowserApi.isSafariApi ? 'safari' : null, async (formattedLocale: string) => {
if (BrowserApi.isSafariApi) {
const localeJson = await SafariApp.sendMessageToApp('getLocaleStrings', formattedLocale);
return JSON.parse(localeJson);
await SafariApp.sendMessageToApp('getLocaleStrings', formattedLocale);
return (window as any).bitwardenLocaleStrings;
} else {
// Deprecated
const file = await fetch(this.localesDirectory + formattedLocale + '/messages.json');