Upgrade of modules and webpack.
Support for localization in progress.
This commit is contained in:
parent
d8b56fff0d
commit
4862d6cac4
52 changed files with 5870 additions and 23064 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue