Opened 13 years ago
Last modified 13 years ago
#1683 new defect (bug)
Dashboard "Right Now" counts don't correctly use plurals
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release (Legacy) | Priority: | normal |
Severity: | normal | Version: | 1.1-alpha |
Component: | General - Administration | Keywords: | |
Cc: | jclermont@… |
Description
[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)
Note: See
TracTickets for help on using
tickets.
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!