Files
edx-platform/common/static/js/test/i18n.js
2016-08-08 15:59:18 -04:00

11 lines
402 B
JavaScript

window.gettext = function(s) { return s; };
window.ngettext = function(singular, plural, num) { return num == 1 ? singular : plural; };
function interpolate(fmt, obj, named) {
if (named) {
return fmt.replace(/%\(\w+\)s/g, function(match) { return String(obj[match.slice(2, -2)]); });
} else {
return fmt.replace(/%s/g, function(match) { return String(obj.shift()); });
}
}