Mercurial > gemma
view client/src/locale/languages.js @ 5408:901b70f9c6bd marking-single-beam
disable cuts or differences if surveytype is 'marking'
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 06 Jul 2021 15:47:44 +0200 |
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 };