1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-17 00:32:37 +00:00
seahub/frontend/src/i18n.js

36 lines
640 B
JavaScript
Raw Normal View History

2018-05-02 06:09:58 +00:00
import i18n from 'i18next';
import XHR from 'i18next-xhr-backend';
let siteRoot = window.app.config.siteRoot;
i18n
.use(XHR)
.init({
fallbackLng: 'en',
ns: ['translations'],
defaultNS: 'translations',
whitelist: ['en', 'zh-CN'],
backend: {
loadPath: siteRoot + 'media/assets/frontend/locales/{{ lng }}/{{ ns }}.json',
// 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;