Some bits for ReactJS-based client.

This commit is contained in:
Tomas Bures 2017-05-28 18:49:00 +02:00
parent 115d254baf
commit 4f52b571c9
27 changed files with 2326 additions and 202 deletions

29
client/src/i18n.js Normal file
View file

@ -0,0 +1,29 @@
import i18n from 'i18next';
import XHR from 'i18next-xhr-backend';
// import Cache from 'i18next-localstorage-cache';
i18n
.use(XHR)
// .use(Cache)
.init({
lng: 'en', // FIXME set language from mailtrain (ideally from react-root.hbs)
wait: true, // globally set to wait for loaded translations in translate hoc
// have a common namespace used around the full app
ns: ['common'],
defaultNS: 'common',
debug: true,
// cache: {
// enabled: true
// },
interpolation: {
escapeValue: false // not needed for react
}
});
export default i18n;