Upgrade of modules and webpack.

Support for localization in progress.
This commit is contained in:
Tomas Bures 2018-11-17 23:26:45 +01:00
parent d8b56fff0d
commit 4862d6cac4
52 changed files with 5870 additions and 23064 deletions

View file

@ -1,35 +1,34 @@
import i18n from 'i18next';
import XHR from 'i18next-xhr-backend';
// import Cache from 'i18next-localstorage-cache';
import { reactI18nextModule } from "react-i18next";
import LanguageDetector from 'i18next-browser-languagedetector';
import mailtrainConfig from 'mailtrainConfig';
import {getUrl} from "./urls";
import commonEn from "../../../locales/common/en";
i18n
.use(XHR)
// .use(Cache)
.use(LanguageDetector)
.init({
lng: mailtrainConfig.language,
resources: {
en: {
common: commonEn
}
},
wait: true, // globally set to wait for loaded translations in translate hoc
// have a common namespace used around the full app
ns: ['common'],
fallbackLng: "en",
defaultNS: 'common',
debug: false,
// cache: {
// enabled: true
// },
interpolation: {
escapeValue: false // not needed for react
},
backend: {
loadPath: getUrl('locales/{{lng}}/{{ns}}.json')
}
});
react: {
wait: true
},
debug: true
})
export default i18n;