mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-09 22:09:07 +01:00
Théo LUDWIG
6b29ce9b15
Improvements: - Hide switch theme input (ugly little white square) - i18n without subpath (e.g: /fr or /en), same url whatever the locale used
33 lines
853 B
TypeScript
33 lines
853 B
TypeScript
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
|
|
)
|