Merge branch 'master' of github.com:bitwarden/browser
This commit is contained in:
commit
9ee25156bd
|
@ -136,8 +136,7 @@ export default class MainBackground {
|
||||||
});
|
});
|
||||||
this.storageService = new BrowserStorageService(this.platformUtilsService);
|
this.storageService = new BrowserStorageService(this.platformUtilsService);
|
||||||
this.secureStorageService = new BrowserStorageService(this.platformUtilsService);
|
this.secureStorageService = new BrowserStorageService(this.platformUtilsService);
|
||||||
this.i18nService = new I18nService(BrowserApi.getUILanguage(window),
|
this.i18nService = new I18nService(BrowserApi.getUILanguage(window));
|
||||||
BrowserApi.isSafariApi ? './_locales/' : null);
|
|
||||||
const cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService);
|
const cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService);
|
||||||
this.cryptoService = new CryptoService(this.storageService, this.secureStorageService, cryptoFunctionService);
|
this.cryptoService = new CryptoService(this.storageService, this.secureStorageService, cryptoFunctionService);
|
||||||
this.tokenService = new TokenService(this.storageService);
|
this.tokenService = new TokenService(this.storageService);
|
||||||
|
|
|
@ -1,10 +1,19 @@
|
||||||
import { I18nService as BaseI18nService } from 'jslib/services/i18n.service';
|
import { I18nService as BaseI18nService } from 'jslib/services/i18n.service';
|
||||||
|
|
||||||
|
import { BrowserApi } from '../browser/browserApi';
|
||||||
|
import { SafariApp } from '../browser/safariApp';
|
||||||
|
|
||||||
export default class I18nService extends BaseI18nService {
|
export default class I18nService extends BaseI18nService {
|
||||||
constructor(systemLanguage: string, localesDirectory: string) {
|
constructor(systemLanguage: string) {
|
||||||
super(systemLanguage, localesDirectory, async (formattedLocale: string) => {
|
super(systemLanguage, BrowserApi.isSafariApi ? 'safari' : null, async (formattedLocale: string) => {
|
||||||
const file = await fetch(localesDirectory + formattedLocale + '/messages.json');
|
if (BrowserApi.isSafariApi) {
|
||||||
return await file.json();
|
const localeJson = await SafariApp.sendMessageToApp('getLocaleStrings', formattedLocale);
|
||||||
|
return JSON.parse(localeJson);
|
||||||
|
} else {
|
||||||
|
// Deprecated
|
||||||
|
const file = await fetch(this.localesDirectory + formattedLocale + '/messages.json');
|
||||||
|
return await file.json();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.supportedTranslationLocales = [
|
this.supportedTranslationLocales = [
|
||||||
|
|
Loading…
Reference in New Issue