WordPress.org

Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#43537 closed defect (bug) (invalid)

_n() returns plural when count is zero

Reported by: arena Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

_n() returns plural when count is zero

<?php
sprintf( _n( 'penny', 'pence', 0 ), 0 );

should return 'penny' and not 'pence'.

Attachments (1)

#.patch (1.3 KB) - added by arena 18 months ago.
patch

Download all attachments as: .zip

Change History (6)

@arena
18 months ago

patch

#1 @arena
18 months ago

  • Keywords has-patch added

#2 @birgire
18 months ago

I think I would have used the plural form 0 pence, but note that English is not my first language ;-)

I guess it also depends on the language. In Icelandic I think it's custom to say 0 krónur (plural) instead of 0 króna (singular).

#3 @juhise
18 months ago

@arena

In english only 1 is considered as singular, zero is always considered as plural. It seems correct to me.
Refer https://english.stackexchange.com/questions/38293/why-is-zero-followed-by-a-plural-noun

#4 @ocean90
18 months ago

  • Component changed from General to I18N
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version trunk deleted

In English, a zero value is always followed by a plural form. Note that plural forms can be adjusted per locale.

#5 @arena
18 months ago

sorry, not in french !

Note: See TracTickets for help on using tickets.