Skip to content
Snippets Groups Projects
Commit 8e97345f authored by Léopold Chappuis's avatar Léopold Chappuis Committed by Adrien Béraud
Browse files

i18n: improved logic

Change-Id: I3ebec8ce402ac693795301d36c3440f023d064ae
parent 093f595d
Branches
No related tags found
No related merge requests found
......@@ -60,11 +60,7 @@ export const languagesInfos: readonly LanguageInfo[] = await Promise.all(languag
const lastLanguage = localStorage.getItem('language')
// transifex uses underscores instead of dashes
const systemLanguage = navigator.language.replace('-', '_')
const defaultLanguage = lastLanguage
? lastLanguage
: availableLanguages.includes(systemLanguage)
? systemLanguage
: 'en'
const defaultLanguage = lastLanguage || (availableLanguages.includes(systemLanguage) ? systemLanguage : 'en')
const initialResources = await getTranslation(defaultLanguage)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment