mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 11:15:23 -04:00
format code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
b459dc2c0d
commit
abceb356db
1 changed files with 11 additions and 11 deletions
|
@ -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({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue