mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-26 16:42:44 +00:00
Improve localization func to support placeholders
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user