forked from fanruan/fineui
guy
6 years ago
21 changed files with 547 additions and 515 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,30 @@ |
|||||||
|
!(function () { |
||||||
|
var i18nStore = {}; |
||||||
|
_.extend(BI, { |
||||||
|
addI18n: function (i18n) { |
||||||
|
BI.extend(i18nStore, i18n); |
||||||
|
}, |
||||||
|
i18nText: function (key) { |
||||||
|
var localeText = i18nStore[key] || (BI.i18n && BI.i18n[key]) || ""; |
||||||
|
if (!localeText) { |
||||||
|
localeText = key; |
||||||
|
} |
||||||
|
var len = arguments.length; |
||||||
|
if (len > 1) { |
||||||
|
if (localeText.indexOf("{R1}") > -1) { |
||||||
|
for (var i = 1; i < len; i++) { |
||||||
|
var key = "{R" + i + "}"; |
||||||
|
localeText = BI.replaceAll(localeText, key, arguments[i] + ""); |
||||||
|
} |
||||||
|
} else { |
||||||
|
var args = Array.prototype.slice.call(arguments); |
||||||
|
var count = 1; |
||||||
|
return BI.replaceAll(localeText, "\\{\\s*\\}", function () { |
||||||
|
return args[count++] + ""; |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
return localeText; |
||||||
|
} |
||||||
|
}); |
||||||
|
})(); |
Loading…
Reference in new issue