Merge pull request #3769 from matrix-org/travis/babel7-wp-lang-dropdown

Define getLanguageFromBrowser() for LanguageDropdown
This commit is contained in:
Travis Ralston 2019-12-25 15:15:55 -07:00 committed by GitHub
commit 58f169be92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -336,6 +336,10 @@ export function getLanguagesFromBrowser() {
return [navigator.userLanguage || "en"];
}
export function getLanguageFromBrowser() {
return getLanguagesFromBrowser()[0];
}
/**
* Turns a language string, normalises it,
* (see normalizeLanguageKey) into an array of language strings