INNER CODE UNIT · JavaScript

setLanguageCookie

XiaoMi/naftis · src/ui/src/commons/languages/index.js:45

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) => {
  return intl.formatMessage({ id })
}

export {
  getLangFromCookie,
  getIstioLangFromCookie,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…