Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
da3c19b3
Commit
da3c19b3
authored
Aug 29, 2007
by
Gábor Hojtsy
Browse files
#170334
by JirkaRybka: allow @count to be used in singular format_plural() values too
parent
d8b17c9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
da3c19b3
...
...
@@ -955,10 +955,10 @@ function format_xml_elements($array) {
* A translated string.
*/
function
format_plural
(
$count
,
$singular
,
$plural
,
$args
=
array
(),
$langcode
=
NULL
)
{
$args
[
'@count'
]
=
$count
;
if
(
$count
==
1
)
{
return
t
(
$singular
,
$args
);
return
t
(
$singular
,
$args
,
$langcode
);
}
$args
[
'@count'
]
=
$count
;
// get the plural index through the gettext formula
$index
=
(
function_exists
(
'locale_get_plural'
))
?
locale_get_plural
(
$count
,
$langcode
)
:
-
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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