Use preferred system locales and add Farsi font stack

This commit is contained in:
Jamie Kyle 2023-01-24 16:54:46 -08:00 committed by GitHub
parent fbdfaf3962
commit da0a741a36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 124 additions and 72 deletions

View file

@ -37,11 +37,17 @@ activeWindowService.initialize(window.document, ipcRenderer);
const params = new URLSearchParams(document.location.search);
const configParam = params.get('config');
strictAssert(typeof configParam === 'string', 'config is not a string');
const config = JSON.parse(configParam);
const config: RendererConfigType = JSON.parse(configParam);
const { locale } = config;
strictAssert(locale, 'locale could not be parsed from config');
strictAssert(typeof locale === 'string', 'locale is not a string');
const { resolvedTranslationsLocale } = config;
strictAssert(
resolvedTranslationsLocale,
'locale could not be parsed from config'
);
strictAssert(
typeof resolvedTranslationsLocale === 'string',
'locale is not a string'
);
const localeMessages = ipcRenderer.sendSync('locale-data');
setEnvironment(parseEnvironment(config.environment));
@ -114,7 +120,7 @@ export const SignalContext: SignalContextType = {
getPath: (name: 'userData' | 'home'): string => {
return String(config[`${name}Path`]);
},
i18n: setupI18n(locale, localeMessages),
i18n: setupI18n(resolvedTranslationsLocale, localeMessages),
localeMessages,
log: window.SignalContext.log,
nativeThemeListener: createNativeThemeListener(ipcRenderer, window),