From 83013c90d2aa9539a2ad20bc68c218ec078a1da1 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 25 Jan 2007 19:29:30 +0000 Subject: [PATCH] Do not pass comma-formatted numbers to __ngettext(). Props nbachiyski. fixes #3663 git-svn-id: https://develop.svn.wordpress.org/trunk@4808 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/index.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/wp-admin/index.php b/wp-admin/index.php index 92702e329f..53c4ddf9f6 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -98,21 +98,16 @@ foreach ($scheduled as $post) {

get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'"); -if (0 < $numposts) $numposts = number_format($numposts); +$numposts = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'"); +$numcomms = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); +$numcats = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); -$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); -if (0 < $numcomms) $numcomms = number_format($numcomms); - -$numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); -if (0 < $numcats) $numcats = number_format($numcats); +$post_str = sprintf(__ngettext('%1$s post', '%1$s posts', $numposts), number_format($numposts), 'edit.php'); +$comm_str = sprintf(__ngettext('%1$s comment', '%1$s comments', $numcomms), number_format($numcomms), 'edit-comments.php'); +$cat_str = sprintf(__ngettext('%1$s category', '%1$s categories', $numcats), number_format($numcats), 'categories.php'); ?> -

post', '%1$s posts', $numposts), $numposts, 'edit.php'); -$comm_str = sprintf(__ngettext('%1$s comment', '%1$s comments', $numcomms), $numcomms, 'edit-comments.php'); -$cat_str = sprintf(__ngettext('%1$s category', '%1$s categories', $numcats), $numcats, 'categories.php'); -printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?>

+