Opened 17 years ago
Closed 17 years ago
#5606 closed defect (bug) (fixed)
i18n formatting breaks dashboard count
Reported by: | sarekofvulcan | Owned by: | ryan |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Administration | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description (last modified by )
I have 1812 posts in my blog, but my dashboard is reporting that I have "1 posts". I added the following code to wp-admin/index.php immediately after the $num_posts line:
echo $num_posts;
echo ngettext( '%d post', '%d posts', $num_posts);
echo number_format_i18n($num_posts);
echo sprintf('%d posts', '1,812');
The answers were:
1812
%d posts
1,812
1 posts
So, it appears that that comma makes sprintf unhappy.
Attachments (1)
Change History (12)
#4
@
17 years ago
Thanks, lloydbudd.
I'm attaching a diff: it fixes the post count, but none of my other counts are high enough to properly test the others.
#8
in reply to:
↑ 7
@
17 years ago
Replying to nbachiyski:
The patch forks for me, I have a sample install with lots of 'em.
*is confused* Is that a typo for "works"?
Note: See
TracTickets for help on using
tickets.
Well, there were line breaks in there before... Just for clarity, that's
{{{echo $num_posts;
echo ngettext( '%d post', '%d posts', $num_posts);
echo number_format_i18n($num_posts);
echo sprintf('%d posts', '1,812');}}}
and
{{{1812
%d posts
1,812
1 posts}}}