frontend/i18n.ts (view raw)
1import i18n from 'i18next';
2import {initReactI18next} from 'react-i18next';
3import translationFr from './locales/fr.json';
4import translationEn from './locales/en.json';
5
6const resources = {
7 fr: {
8 translation: translationFr,
9 },
10 en: {
11 translation: translationEn,
12 },
13};
14
15i18n
16 .use(initReactI18next) // passes i18n down to react-i18next
17 .init({
18 resources,
19 lng: 'fr',
20 interpolation: {
21 escapeValue: false, // react already safes from xss
22 },
23 });
24
25export default i18n;