I have one legacy application in which I have to use translation. for that I am installing below dependency.
"i18next": "^21.6.3", "react-i18next": "^9.0.10",
i18n.js
import i18n from 'i18next';
import { reactI18nextModule } from 'react-i18next';
import translationEN from '../public/locales/en/translation.json';
// the translations
const resources = {
en: {
translation: translationEN,
},
};
i18n
.use(reactI18nextModule) // passes i18n down to react-i18next
.init({
resources,
lng: 'en',
keySeparator: false, // we do not use keys in form messages.welcome
interpolation: {
escapeValue: false, // react already safes from xss
},
});
export default i18n;
I am not doing anything yet but just importing
this file in my class component
and it started giving below error. I am not sure what mistake I am doing.