Mercurial > gemma
view client/src/locale/languages.js @ 5131:52e3980e3462 queued-stage-done
review decisions controller: Lowered immediate feedback timeout to 5 secs.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 27 Mar 2020 13:09:02 +0100 |
parents | 24e3e86b8cb6 |
children |
line wrap: on
line source
import * as browserLanguage from "locale2"; // planned also RS, BiH, UA const supportedLanguages = { en_GB: "British English", de_AT: "Deutsch", sk_SK: "slovenčina", hu_HU: "Magyar", hr_HR: "Hrvatska", bg_BG: "български", ro_RO: "Română" }; let isAvailableLanguage = Object.keys(supportedLanguages).filter(language => { return browserLanguage.replace("-", "_") === language; }); if (isAvailableLanguage.length === 0) { isAvailableLanguage = Object.keys(supportedLanguages).filter(language => { return language.substr(0, 2) === browserLanguage.substr(0, 2); }); } let defaultLanguage = isAvailableLanguage.length > 0 ? isAvailableLanguage[0] : "en_GB"; export { supportedLanguages, defaultLanguage };