2019-09-08 11:17:02 +02:00
|
|
|
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'
|
2019-09-08 11:17:02 +02:00
|
|
|
|
|
|
|
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,
|
2019-09-08 11:17:02 +02:00
|
|
|
},
|
|
|
|
fr: {
|
2019-09-08 11:35:30 +02:00
|
|
|
common: FrCommonTranslations,
|
|
|
|
user: FrUserTranslations,
|
2019-09-08 11:17:02 +02:00
|
|
|
},
|
|
|
|
},
|
2019-09-08 11:35:30 +02:00
|
|
|
ns: ['common'],
|
|
|
|
defaultNS: 'common',
|
2019-09-08 11:17:02 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
export default i18n
|