format code

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-11-20 19:10:36 +01:00
parent b459dc2c0d
commit abceb356db

View file

@ -5,7 +5,7 @@
*/ */
import type { ResourceKey } from 'i18next' import type { ResourceKey } from 'i18next'
import i18n, { use as i18nUse } from 'i18next' import i18n, { use as i18nUse } from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector' import LanguageDetector from 'i18next-browser-languagedetector'
import resourcesToBackend from 'i18next-resources-to-backend' import resourcesToBackend from 'i18next-resources-to-backend'
import { Settings } from 'luxon' import { Settings } from 'luxon'
@ -13,16 +13,16 @@ import { initReactI18next } from 'react-i18next'
export const setUpI18n = async (): Promise<void> => { export const setUpI18n = async (): Promise<void> => {
await i18nUse( await i18nUse(
resourcesToBackend((language, namespace, callback) => { resourcesToBackend((language, namespace, callback) => {
import(`../../../../../locales/${language}.json`) import(`../../../../../locales/${language}.json`)
.then((resources: ResourceKey) => { .then((resources: ResourceKey) => {
callback(null, resources) callback(null, resources)
}) })
.catch((error: Error) => { .catch((error: Error) => {
callback(error, null) callback(error, null)
}) })
}) })
) )
.use(LanguageDetector) .use(LanguageDetector)
.use(initReactI18next) .use(initReactI18next)
.init({ .init({