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
6238bf44
Commit
6238bf44
authored
Oct 27, 2004
by
Dries
Browse files
:- Patch
#12096
by Axel: fixed problem with plurals for some languages.
parent
a4cc9aa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
6238bf44
...
@@ -869,7 +869,7 @@ function format_rss_item($title, $link, $description, $args = array()) {
...
@@ -869,7 +869,7 @@ function format_rss_item($title, $link, $description, $args = array()) {
* A translated string.
* A translated string.
*/
*/
function
format_plural
(
$count
,
$singular
,
$plural
)
{
function
format_plural
(
$count
,
$singular
,
$plural
)
{
if
(
$count
==
1
)
return
t
(
$singular
);
if
(
$count
==
1
)
return
t
(
$singular
,
array
(
"%count"
=>
$count
)
);
// get the plural index through the gettext formula
// get the plural index through the gettext formula
$index
=
(
function_exists
(
'locale'
))
?
locale_get_plural
(
$count
)
:
-
1
;
$index
=
(
function_exists
(
'locale'
))
?
locale_get_plural
(
$count
)
:
-
1
;
...
@@ -879,7 +879,7 @@ function format_plural($count, $singular, $plural) {
...
@@ -879,7 +879,7 @@ function format_plural($count, $singular, $plural) {
else
{
else
{
switch
(
$index
)
{
switch
(
$index
)
{
case
"0"
:
case
"0"
:
return
t
(
$singular
);
return
t
(
$singular
,
array
(
"%count"
=>
$count
)
);
case
"1"
:
case
"1"
:
return
t
(
$plural
,
array
(
"%count"
=>
$count
));
return
t
(
$plural
,
array
(
"%count"
=>
$count
));
default
:
default
:
...
...
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