// 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'
import { loadedFormatters, loadedLocales, locales } from './i18n-util'

import de from './de'
import en from './en'
import es from './es'
import ja from './ja'
import pt_br from './pt-br'
import tr from './tr'
import vi from './vi'
import zh_cn from './zh-cn'

const localeTranslations = {
	de,
	en,
	es,
	ja,
	'pt-br': pt_br,
	tr,
	vi,
	'zh-cn': zh_cn,
}

export const loadLocale = (locale: Locales): void => {
	if (loadedLocales[locale]) return

	loadedLocales[locale] = localeTranslations[locale] as unknown as Translations
	loadFormatters(locale)
}

export const loadAllLocales = (): void => locales.forEach(loadLocale)

export const loadFormatters = (locale: Locales): void =>
	void (loadedFormatters[locale] = initFormatters(locale))
