mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 09:46:09 +03:00
Merge pull request #956 from matrix-org/t3chguy/i18n_electron
fix i18n in a situation where navigator.languages=[]
This commit is contained in:
commit
970784f0c0
1 changed files with 3 additions and 3 deletions
|
@ -87,10 +87,10 @@ export function getAllLanguageKeysFromJson() {
|
|||
}
|
||||
|
||||
export function getLanguagesFromBrowser() {
|
||||
if (navigator.languages) return navigator.languages;
|
||||
if (navigator.language) return [navigator.language]
|
||||
if (navigator.languages && navigator.languages.length) return navigator.languages;
|
||||
if (navigator.language) return [navigator.language];
|
||||
return [navigator.userLanguage];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns a language string, normalises it,
|
||||
|
|
Loading…
Reference in a new issue