Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
7f5bc4e9
Commit
7f5bc4e9
authored
Apr 08, 2015
by
alexpott
Browse files
Issue
#2397225
by Chi, ufku: Drupal.formatPlural does not work
parent
3e275d65
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/misc/drupal.js
View file @
7f5bc4e9
...
...
@@ -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
'
@
'
:
a
rgs
[
key
]
=
Drupal
.
checkPlain
(
args
[
key
]);
processedA
rgs
[
key
]
=
Drupal
.
checkPlain
(
args
[
key
]);
break
;
// Pass-through.
case
'
!
'
:
processedArgs
[
key
]
=
args
[
key
];
break
;
// Escaped and placeholder.
default
:
a
rgs
[
key
]
=
Drupal
.
theme
(
'
placeholder
'
,
args
[
key
]);
processedA
rgs
[
key
]
=
Drupal
.
theme
(
'
placeholder
'
,
args
[
key
]);
break
;
}
}
}
return
Drupal
.
stringReplace
(
str
,
a
rgs
,
null
);
return
Drupal
.
stringReplace
(
str
,
processedA
rgs
,
null
);
};
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment