Commit 42e44377 authored by Elisabeth Reuhl's avatar Elisabeth Reuhl
Browse files

Added i18next, react-i18next

parent 2e421c52
......@@ -30,7 +30,9 @@
"webpack-dev-server": "^3.9.0"
},
"dependencies": {
"i18next": "^19.1.0",
"react": "^16.12.0",
"react-dom": "^16.12.0"
"react-dom": "^16.12.0",
"react-i18next": "^11.3.1"
}
}
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import translationsAR from '../public/locales/translationsAR.json';
import translationsDE from '../public/locales/translationsDE.json';
import translationsEN from '../public/locales/translationsEN.json';
import translationsFR from '../public/locales/translationsFR.json';
// the translations
const resources = {
ar: {
translation: translationsAR
},
de: {
translation: translationsDE
},
en: {
translation: translationsEN
},
fr: {
translation: translationsFR
},
};
i18n
.use(initReactI18next) // 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;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment