// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten. /* eslint-disable */ import { initFormatters } from './formatters' import type { Locales, Translations } from './i18n-types.js' import { loadedFormatters, loadedLocales, locales } from './i18n-util' const localeTranslationLoaders = { en: () => import('./en/index.js'), nb: () => import('./nb/index.js'), } const updateDictionary = (locale: Locales, dictionary: Partial) => loadedLocales[locale] = { ...loadedLocales[locale], ...dictionary } export const loadLocaleAsync = async (locale: Locales): Promise => { updateDictionary( locale, (await localeTranslationLoaders[locale]()).default as unknown as Translations ) loadFormatters(locale) } export const loadAllLocalesAsync = (): Promise => Promise.all(locales.map(loadLocaleAsync)) export const loadFormatters = (locale: Locales): void => void (loadedFormatters[locale] = initFormatters(locale))