Commit 7f5bc4e9 authored by alexpott's avatar alexpott
Browse files

Issue #2397225 by Chi, ufku: Drupal.formatPlural does not work

parent 3e275d65
......@@ -214,26 +214,29 @@ if (window.jQuery) {
* @ingroup sanitization
*/
Drupal.formatString = function (str, args) {
// Keep args intact.
var processedArgs = {};
// Transform arguments before inserting them.
for (var key in args) {
if (args.hasOwnProperty(key)) {
switch (key.charAt(0)) {
// Escaped only.
case '@':
args[key] = Drupal.checkPlain(args[key]);
processedArgs[key] = Drupal.checkPlain(args[key]);
break;
// Pass-through.
case '!':
processedArgs[key] = args[key];
break;
// Escaped and placeholder.
default:
args[key] = Drupal.theme('placeholder', args[key]);
processedArgs[key] = Drupal.theme('placeholder', args[key]);
break;
}
}
}
return Drupal.stringReplace(str, args, null);
return Drupal.stringReplace(str, processedArgs, null);
};
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment