mirror of https://github.com/vector-im/riot-web
Merge pull request #956 from matrix-org/t3chguy/i18n_electron
fix i18n in a situation where navigator.languages=[]pull/21833/head
commit
970784f0c0
|
@ -87,10 +87,10 @@ export function getAllLanguageKeysFromJson() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLanguagesFromBrowser() {
|
export function getLanguagesFromBrowser() {
|
||||||
if (navigator.languages) return navigator.languages;
|
if (navigator.languages && navigator.languages.length) return navigator.languages;
|
||||||
if (navigator.language) return [navigator.language]
|
if (navigator.language) return [navigator.language];
|
||||||
return [navigator.userLanguage];
|
return [navigator.userLanguage];
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns a language string, normalises it,
|
* Turns a language string, normalises it,
|
||||||
|
|
Loading…
Reference in New Issue