[third] Integrate i18next with Handlebars

This commit is contained in:
Umair Khan
2016-05-13 15:44:03 +05:00
committed by Tim Abbott
parent da69949ccd
commit 82b5d9304b
11 changed files with 307 additions and 5 deletions

View File

@@ -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
});