INNER CODE UNIT · TypeScript

resolveInitialLocale

evolution-foundation/evo-nexus · dashboard/frontend/src/i18n/index.ts:76

function resolveInitialLocale(): SupportedLocale {
  if (typeof window === 'undefined') return DEFAULT_LOCALE
  try {
    const stored = localStorage.getItem('evo_lang')
    if (stored) return normalizeLocale(stored)
  } catch {
    // storage disabled — fall through
  }
  return normalizeLocale(navigator.language)
}

i18n
  .use(initReactI18next)
  .init({
    resources,
    lng: resolveInitialLocale(),
    fallbackLng: DEFAULT_LOCALE,
    interpolation: {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…