2024-04-06 13:25:13 +08:00
|
|
|
import deepObjectExtend from 'new-dashboard/utils/deep-object-extend';
|
|
|
|
|
2024-04-07 01:23:07 +08:00
|
|
|
var moment=require('moment');
|
|
|
|
|
2024-04-07 01:11:59 +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);
|