|
|
|
@ -213,13 +213,14 @@
|
|
|
|
|
|
|
|
|
|
function insertLanguage(text, key, value, variables) {
|
|
|
|
|
if (value) {
|
|
|
|
|
var variable;
|
|
|
|
|
for (var i = 1, ii = variables.length; i < ii; i++) {
|
|
|
|
|
variable = S(variables[i]).chompRight(']]').collapseWhitespace().decodeHTMLEntities().escapeHTML().s;
|
|
|
|
|
value = value.replace('%' + i, variable);
|
|
|
|
|
variables.forEach(function(variable, index) {
|
|
|
|
|
if (index > 0) {
|
|
|
|
|
variable = S(variable).chompRight(']]').collapseWhitespace().decodeHTMLEntities().escapeHTML().s;
|
|
|
|
|
value = value.replace('%' + index, function() { return variable; });
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
text = text.replace(key, value);
|
|
|
|
|
text = text.replace(key, function() { return value; });
|
|
|
|
|
} else {
|
|
|
|
|
var string = key.split(':');
|
|
|
|
|
text = text.replace(key, string[string.length-1].replace(regexes.replace, ''));
|
|
|
|
|