aboutsummaryrefslogtreecommitdiffstats
path: root/apps/projects/src/app/lib/i18n/i18n-util.async.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/projects/src/app/lib/i18n/i18n-util.async.ts')
-rw-r--r--apps/projects/src/app/lib/i18n/i18n-util.async.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/apps/projects/src/app/lib/i18n/i18n-util.async.ts b/apps/projects/src/app/lib/i18n/i18n-util.async.ts
deleted file mode 100644
index 3ccef5f..0000000
--- a/apps/projects/src/app/lib/i18n/i18n-util.async.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-// 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'
-
-const localeTranslationLoaders = {
- en: () => import('./en'),
- nb: () => import('./nb'),
-}
-
-const updateDictionary = (locale: Locales, dictionary: Partial<Translations>) =>
- loadedLocales[locale] = { ...loadedLocales[locale], ...dictionary }
-
-export const importLocaleAsync = async (locale: Locales) =>
- (await localeTranslationLoaders[locale]()).default as unknown as Translations
-
-export const loadLocaleAsync = async (locale: Locales): Promise<void> => {
- updateDictionary(locale, await importLocaleAsync(locale))
- loadFormatters(locale)
-}
-
-export const loadAllLocalesAsync = (): Promise<void[]> => Promise.all(locales.map(loadLocaleAsync))
-
-export const loadFormatters = (locale: Locales): void =>
- void (loadedFormatters[locale] = initFormatters(locale))