[wp-trac] Re: [WordPress Trac] #5606: i18n formatting breaks dashboard count

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 8 18:47:54 GMT 2008


#5606: i18n formatting breaks dashboard count
----------------------------+-----------------------------------------------
 Reporter:  sarekofvulcan   |        Owner:  anonymous
     Type:  defect          |       Status:  new      
 Priority:  normal          |    Milestone:  2.5      
Component:  Administration  |      Version:  2.5      
 Severity:  normal          |   Resolution:           
 Keywords:                  |  
----------------------------+-----------------------------------------------
Old description:

> 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.

New description:

 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; [[br]]
 echo __ngettext( '%d post', '%d posts', $num_posts); [[br]]
 echo number_format_i18n($num_posts); [[br]]
 echo sprintf('%d posts', '1,812'); [[br]]

 The answers were: [[br]]
 1812 [[br]]
 %d posts [[br]]
 1,812 [[br]]
 1 posts [[br]]

 So, it appears that that comma makes sprintf unhappy.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5606#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list