Browse Source

CORE-127 简化前端国际化写法

es6
Dailer 6 years ago
parent
commit
42d3384d26
  1. 13
      src/core/base.js

13
src/core/base.js

@ -43,14 +43,11 @@ if (!_global.BI) {
if (!localeText) { if (!localeText) {
localeText = key; localeText = key;
} }
var len = arguments.length; var args = Array.prototype.slice.call(arguments);
var regexp = new RegExp("\\{\\s*\\}"); var count = 1;
if (len > 1) { return BI.replaceAll(localeText, "\\{\\s*\\}", function () {
for (var i = 1; i < len; i++) { return args[count++] + "";
localeText = localeText.replace(regexp, arguments[i] + ""); });
}
}
return localeText;
}, },
assert: function (v, is) { assert: function (v, is) {

Loading…
Cancel
Save