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

fix i18n in a situation where navigator.languages=[]
pull/21833/head
Matthew Hodgson 2017-05-30 00:07:30 +01:00 committed by GitHub
commit 970784f0c0
1 changed files with 3 additions and 3 deletions

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,