2024-04-06 13:25:13 +08:00
|
|
|
import deepObjectExtend from 'new-dashboard/utils/deep-object-extend';
|
|
|
|
|
2024-04-06 22:58:39 +08:00
|
|
|
var ACTIVE_LOCALE = 'zh-cn';
|
2024-04-06 13:25:13 +08:00
|
|
|
if (ACTIVE_LOCALE !== 'en') {
|
|
|
|
require('moment/locale/' + ACTIVE_LOCALE);
|
|
|
|
}
|
|
|
|
|
|
|
|
var Locale = require('locale/index');
|
|
|
|
var Polyglot = require('node-polyglot');
|
|
|
|
|
|
|
|
// Override original translation strings
|
|
|
|
const overrideTranslationStrings = require('./locales/en.overrides.json');
|
|
|
|
Locale.en = deepObjectExtend(Locale.en, overrideTranslationStrings);
|
|
|
|
|
|
|
|
var polyglot = new Polyglot({
|
|
|
|
locale: ACTIVE_LOCALE, // Needed for pluralize behaviour
|
|
|
|
phrases: Locale[ACTIVE_LOCALE]
|
|
|
|
});
|
|
|
|
|
|
|
|
window._t = polyglot.t.bind(polyglot);
|