mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-10 11:21:29 +00:00
seafile-editor-master-dist
This commit is contained in:
35
frontend/src/i18n.js
Normal file
35
frontend/src/i18n.js
Normal file
@@ -0,0 +1,35 @@
|
||||
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;
|
Reference in New Issue
Block a user