FitTrackee/fittrackee_client/src/i18n.js

36 lines
830 B
JavaScript
Raw Normal View History

import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import XHR from 'i18next-xhr-backend'
2019-09-08 11:35:30 +02:00
import EnCommonTranslations from './locales/en/common.json'
import EnUserTranslations from './locales/en/user.json'
import FrCommonTranslations from './locales/fr/common.json'
import FrUserTranslations from './locales/fr/user.json'
i18n
.use(XHR)
.use(LanguageDetector)
.init({
debug: true,
lng: 'en',
fallbackLng: 'en',
keySeparator: false,
interpolation: {
escapeValue: false,
},
resources: {
en: {
2019-09-08 11:35:30 +02:00
common: EnCommonTranslations,
user: EnUserTranslations,
},
fr: {
2019-09-08 11:35:30 +02:00
common: FrCommonTranslations,
user: FrUserTranslations,
},
},
2019-09-08 11:35:30 +02:00
ns: ['common'],
defaultNS: 'common',
})
export default i18n