cartodb-4.42/lib/assets/javascripts/new-dashboard/i18n/backbone-i18n.js

23 lines
644 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
import deepObjectExtend from 'new-dashboard/utils/deep-object-extend';
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);
2024-04-06 13:25:13 +08:00
}
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);