25 lines
523 B
JavaScript
25 lines
523 B
JavaScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
import frTranslation from './locales/fr.json';
|
|
import enTranslation from './locales/en.json';
|
|
|
|
const resources = {
|
|
fr: { translation: frTranslation },
|
|
en: { translation: enTranslation }
|
|
};
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources,
|
|
fallbackLng: 'fr',
|
|
interpolation: {
|
|
escapeValue: false
|
|
}
|
|
});
|
|
|
|
export default i18n;
|