mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
[third] Integrate i18next with Handlebars
This commit is contained in:
@@ -1 +1,26 @@
|
||||
// commonjs code goes here
|
||||
|
||||
var i18n = window.i18n = require('i18next');
|
||||
var XHR = require('i18next-xhr-backend');
|
||||
var lngDetector = require('i18next-browser-languagedetector');
|
||||
var backendOptions = {
|
||||
loadPath: '/static/locale/__lng__/__ns__.json'
|
||||
};
|
||||
|
||||
var detectionOptions = {
|
||||
order: ['htmlTag'],
|
||||
htmlTag: document.documentElement
|
||||
};
|
||||
|
||||
i18n.use(XHR)
|
||||
.use(lngDetector)
|
||||
.init({
|
||||
nsSeparator: false,
|
||||
keySeparator: false,
|
||||
interpolation: {
|
||||
prefix: "__",
|
||||
suffix: "__"
|
||||
},
|
||||
backend: backendOptions,
|
||||
detection: detectionOptions
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user