INNER CODE UNIT · JavaScript
getLocaleLanguage
XiaoMi/naftis · src/ui/src/commons/languages/index.js:39
const getLocaleLanguage = () => {
const ISTIO_LANG = getIstioLangFromCookie()
const language = require(`./lib/${ISTIO_LANG}`)
return language && language.default
}
const setLanguageCookie = (lang) => {
Cookies.set(CONFIG.ISTIO_LANG_KEY, lang)
}
const setDefaultLanguageCookie = () => {
Cookies.set(CONFIG.ISTIO_LANG_KEY, getLocaleLanguage().locale)
}
const { appLocaleData, locale, messages } = getLocaleLanguage()
addLocaleData(appLocaleData)
const { intl } = new IntlProvider({ locale: locale, messages }, {}).getChildContext()
window.T = (id) => {