mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-13 07:47:12 +00:00
Improve localization func to support placeholders
This commit is contained in:
1 parent
0ad926c4d6
commit
a75bd1aedf
1 file changed
+5
-1
@@ -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