Browse Source

KERNEL-12612 feat: FineUI国际化功能增强

es6
zsmj 2 years ago
parent
commit
22feddf125
  1. 4
      src/core/utils/i18n.js

4
src/core/utils/i18n.js

@ -22,13 +22,13 @@
if (len > 1) { if (len > 1) {
if (localeText.indexOf("{R1") > -1) { if (localeText.indexOf("{R1") > -1) {
for (var i = 1; i < len; i++) { for (var i = 1; i < len; i++) {
var reg = new RegExp(`{R${i},(.*)}`, "g"); var reg = new RegExp(`{R${i},(.*?)}`, "g");
var result = reg.exec(localeText); var result = reg.exec(localeText);
if (result) { if (result) {
var formatName = result[1]; var formatName = result[1];
localeText = BI.replaceAll(localeText, reg, i18nFormatters[formatName](arguments[i])); localeText = BI.replaceAll(localeText, reg, i18nFormatters[formatName](key, arguments[i]));
} else { } else {
localeText = BI.replaceAll(localeText, `{R${i}}`, arguments[i] + ""); localeText = BI.replaceAll(localeText, `{R${i}}`, arguments[i] + "");
} }

Loading…
Cancel
Save