2018-05-02 06:09:58 +00:00
|
|
|
import i18n from 'i18next';
|
|
|
|
import XHR from 'i18next-xhr-backend';
|
2019-07-26 06:13:51 +00:00
|
|
|
import { mediaUrl } from './utils/constants';
|
2018-05-02 06:09:58 +00:00
|
|
|
|
|
|
|
i18n
|
|
|
|
.use(XHR)
|
|
|
|
.init({
|
|
|
|
fallbackLng: 'en',
|
|
|
|
|
|
|
|
ns: ['translations'],
|
|
|
|
defaultNS: 'translations',
|
|
|
|
|
2019-01-28 10:00:04 +00:00
|
|
|
whitelist: ['en', 'zh-CN', 'fr', 'de', 'cs', 'es', 'es-AR', 'es-MX', 'ru'],
|
2018-05-02 06:09:58 +00:00
|
|
|
|
|
|
|
backend: {
|
2019-07-26 06:13:51 +00:00
|
|
|
loadPath: mediaUrl + 'assets/frontend/locales/{{ lng }}/{{ ns }}.json',
|
2018-05-02 06:09:58 +00:00
|
|
|
// loadPath: '/media/locales/{{lng}}/{{ns}}.json',
|
|
|
|
},
|
|
|
|
|
|
|
|
debug: false, // console log if debug: true
|
|
|
|
|
|
|
|
interpolation: {
|
|
|
|
escapeValue: false, // not needed for react!!
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
load: 'currentOnly',
|
|
|
|
|
|
|
|
react: {
|
|
|
|
wait: true,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default i18n;
|