Skip to:

Opened 13 years ago

Last modified 12 years ago

#1683 new defect (bug)

Dashboard "Right Now" counts don't correctly use plurals

Reported by: zerocrates's profile zerocrates Owned by:
Milestone: Future Release (Legacy) Priority: normal
Severity: normal Version: 1.1-alpha
Component: General - Administration Keywords:
Cc: jclermont@…


[2802] changed the way the counts were created to call number_format on each count first, then pass the formatted number to __ngettext. This causes __ngettext to incorrectly pick plurals when the format includes punctuation like a comma.

Example: the dashboard says I have "1,416 topic", but "6,069 posts." Since __ngettext's third argument is an integer, the comma inserted by number_format is screwing up the plural selection.

Instead of, for example:

$rn_topics = number_format( get_total_topics() );
$rn_topics = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics), $rn_topics ); 

it needs to be:

$rn_topics = get_total_topics();
$rn_topics = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics), number_format($rn_topics) ); 

Change History (5)

#1 @johnjamesjacoby
13 years ago

  • Milestone changed from Awaiting Review to 1.2

#2 @jclermont
12 years ago

Are items with 1.x milestones still open for work? Would it be on the 2.0 branch or on the older 1.x branch?

I'd be willing to jump in and take this one once you clear that up for me. Thanks!

#3 @jclermont
12 years ago

  • Cc jclermont@… added

#4 @johnjamesjacoby
12 years ago

Tickets in the 1.x milestones are specific to that older code. You're welcome to fix them if they are outstanding, and you'd want to work from the /branches/1.1/ folder if you do. 1.1 is the final release of the stand-alone version, and all efforts are going into 2.0 and beyond.

#5 @johnjamesjacoby
12 years ago

Which is also to say, /trunk is about to get emptied out, and replaced by /branches/plugin soon.

Note: See TracTickets for help on using tickets.