|
|
@ -164,7 +164,7 @@
|
|
|
|
if (!count) {
|
|
|
|
if (!count) {
|
|
|
|
return callback(text);
|
|
|
|
return callback(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (S === null) { // browser environment and S not yet initialized
|
|
|
|
if (S === null) { // browser environment and S not yet initialized
|
|
|
|
// we need to wait for async require call
|
|
|
|
// we need to wait for async require call
|
|
|
|
stringDefer.then(function () { translateKeys(keys, text, language, callback); });
|
|
|
|
stringDefer.then(function () { translateKeys(keys, text, language, callback); });
|
|
|
@ -205,6 +205,10 @@
|
|
|
|
if (value) {
|
|
|
|
if (value) {
|
|
|
|
var variable;
|
|
|
|
var variable;
|
|
|
|
for (var i = 1, ii = variables.length; i < ii; i++) {
|
|
|
|
for (var i = 1, ii = variables.length; i < ii; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// see https://github.com/NodeBB/NodeBB/issues/1951
|
|
|
|
|
|
|
|
variables[i] = variables[i].replace(/%/g, '%').replace(/,/g, ',');
|
|
|
|
|
|
|
|
|
|
|
|
variable = S(variables[i]).chompRight(']]').collapseWhitespace().escapeHTML().s;
|
|
|
|
variable = S(variables[i]).chompRight(']]').collapseWhitespace().escapeHTML().s;
|
|
|
|
value = value.replace('%' + i, variable);
|
|
|
|
value = value.replace('%' + i, variable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|