FitTrackee/fittrackee_client/src/i18n.js

56 lines
1.9 KiB
JavaScript
Raw Normal View History

import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import XHR from 'i18next-xhr-backend'
2019-09-16 10:26:02 +02:00
import EnActivitiesTranslations from './locales/en/activities.json'
2019-09-08 11:35:30 +02:00
import EnCommonTranslations from './locales/en/common.json'
2019-09-16 10:26:02 +02:00
import EnDashboardTranslations from './locales/en/dashboard.json'
import EnMessagesTranslations from './locales/en/messages.json'
2019-09-16 10:26:02 +02:00
import EnSportsTranslations from './locales/en/sports.json'
import EnStatisticsTranslations from './locales/en/statistics.json'
2019-09-08 11:35:30 +02:00
import EnUserTranslations from './locales/en/user.json'
2019-09-16 10:26:02 +02:00
import FrActivitiesTranslations from './locales/fr/activities.json'
2019-09-08 11:35:30 +02:00
import FrCommonTranslations from './locales/fr/common.json'
2019-09-16 10:26:02 +02:00
import FrDashboardTranslations from './locales/fr/dashboard.json'
import FrMessagesTranslations from './locales/fr/messages.json'
2019-09-16 10:26:02 +02:00
import FrSportsTranslations from './locales/fr/sports.json'
import FrStatisticsTranslations from './locales/fr/statistics.json'
2019-09-08 11:35:30 +02:00
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-16 10:26:02 +02:00
activities: EnActivitiesTranslations,
2019-09-08 11:35:30 +02:00
common: EnCommonTranslations,
2019-09-16 10:26:02 +02:00
dashboard: EnDashboardTranslations,
messages: EnMessagesTranslations,
2019-09-16 10:26:02 +02:00
sports: EnSportsTranslations,
statistics: EnStatisticsTranslations,
2019-09-08 11:35:30 +02:00
user: EnUserTranslations,
},
fr: {
2019-09-16 10:26:02 +02:00
activities: FrActivitiesTranslations,
2019-09-08 11:35:30 +02:00
common: FrCommonTranslations,
2019-09-16 10:26:02 +02:00
dashboard: FrDashboardTranslations,
messages: FrMessagesTranslations,
2019-09-16 10:26:02 +02:00
sports: FrSportsTranslations,
statistics: FrStatisticsTranslations,
2019-09-08 11:35:30 +02:00
user: FrUserTranslations,
},
},
2019-09-08 11:35:30 +02:00
ns: ['common'],
defaultNS: 'common',
})
export default i18n