|
|
@ -399,9 +399,12 @@
|
|
|
|
* @param {...string} arg - Optional argument for the pattern
|
|
|
|
* @param {...string} arg - Optional argument for the pattern
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Translator.compile = function compile() {
|
|
|
|
Translator.compile = function compile() {
|
|
|
|
var args = Array.prototype.slice.call(arguments, 0);
|
|
|
|
var args = Array.prototype.slice.call(arguments, 0).map(function (text) {
|
|
|
|
|
|
|
|
// escape commas and percent signs in arguments
|
|
|
|
|
|
|
|
return text.replace(/%/g, '%').replace(/,/g, ',');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return '[[' + args.join(', ') + ']]';
|
|
|
|
return '[[' + args.join(', ') + ']]';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return Translator;
|
|
|
|
return Translator;
|
|
|
|