Improve localization func to support placeholders
This commit is contained in:
parent
100bec753f
commit
d72d7cc663
|
@ -71,7 +71,8 @@ String.prototype.base64decode = function() {
|
|||
return output;
|
||||
};
|
||||
|
||||
function l(key) {
|
||||
function l() {
|
||||
var key = arguments[0];
|
||||
var value = key;
|
||||
if (labels[key]) {
|
||||
value = labels[key];
|
||||
|
@ -79,6 +80,9 @@ function l(key) {
|
|||
else if (clabels[key]) {
|
||||
value = clabels[key];
|
||||
}
|
||||
for (var i = 1, j = 0; i < arguments.length; i++, j++) {
|
||||
value = value.replace('%{' + j + '}', arguments[i]);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue