1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-09-19 14:05:53 +02:00
.profile/i18n/i18n.ts

33 lines
853 B
TypeScript
Raw Normal View History

import { I18n } from 'i18n-js'
import { DEFAULT_LOCALE, AVAILABLE_LOCALES } from '@/utils/constants'
import commonEnglish from './translations/en-US/common.json'
import errorsEnglish from './translations/en-US/errors.json'
import homeEnglish from './translations/en-US/home.json'
import commonFrench from './translations/fr-FR/common.json'
import errorsFrench from './translations/fr-FR/errors.json'
import homeFrench from './translations/fr-FR/home.json'
export const i18nOptions = {
defaultLocale: DEFAULT_LOCALE,
availableLocales: AVAILABLE_LOCALES.slice(),
enableFallback: true
}
export const i18n = new I18n(
{
'en-US': {
common: commonEnglish,
errors: errorsEnglish,
home: homeEnglish
},
'fr-FR': {
common: commonFrench,
errors: errorsFrench,
home: homeFrench
}
},
i18nOptions
)