mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
@@ -4,6 +4,8 @@
|
||||
var i18n = window.i18n = require('i18next');
|
||||
var XHR = require('i18next-xhr-backend');
|
||||
var lngDetector = require('i18next-browser-languagedetector');
|
||||
var Cache = require('i18next-localstorage-cache');
|
||||
|
||||
var backendOptions = {
|
||||
loadPath: '/static/locale/__lng__/translations.json'
|
||||
};
|
||||
@@ -15,8 +17,14 @@
|
||||
htmlTag: document.documentElement
|
||||
};
|
||||
|
||||
var cacheOptions = {
|
||||
enabled: true,
|
||||
prefix: page_params.server_generation + ':'
|
||||
};
|
||||
|
||||
i18n.use(XHR)
|
||||
.use(lngDetector)
|
||||
.use(Cache)
|
||||
.init({
|
||||
nsSeparator: false,
|
||||
keySeparator: false,
|
||||
@@ -25,7 +33,8 @@
|
||||
suffix: "__"
|
||||
},
|
||||
backend: backendOptions,
|
||||
detection: detectionOptions
|
||||
detection: detectionOptions,
|
||||
cache: cacheOptions
|
||||
}, function () {
|
||||
var i;
|
||||
initialized = true;
|
||||
|
||||
Reference in New Issue
Block a user