Merge pull request #956 from matrix-org/t3chguy/i18n_electron

fix i18n in a situation where navigator.languages=[]
This commit is contained in:
Matthew Hodgson 2017-05-30 00:07:30 +01:00 committed by GitHub
commit 970784f0c0

View file

@ -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,