From 38e868257a3d37630f64166faea1635e2b18541e Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 19 Nov 2006 07:45:28 +0000 Subject: [PATCH] i18n fix for comments_number(). Props Mark Jaquith. fixes #3244 git-svn-id: http://svn.automattic.com/wordpress/trunk@4494 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 8e8d457657..79467de66b 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -161,17 +161,18 @@ function get_comments_number( $post_id = 0 ) { return apply_filters('get_comments_number', $count); } -function comments_number( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $number = '' ) { - global $id, $comment; - $number = get_comments_number( $id ); - if ($number == 0) { - $blah = $zero; - } elseif ($number == 1) { - $blah = $one; - } elseif ($number > 1) { - $blah = str_replace('%', $number, $more); - } - echo apply_filters('comments_number', $blah); +function comments_number( $zero = false, $one = false, $more = false, $number = '' ) { + global $id; + $number = get_comments_number($id); + + if ( $number > 1 ) + $output = str_replace('%', $number, ( false === $more ) ? __('% Comments') : $more); + elseif ( $number == 0 ) + $output = ( false === $zero ) ? __('No Comments') : $zero; + else // must be one + $output = ( false === $one ) ? __('1 Comment') : $one; + + echo apply_filters('comments_number', $output, $number); } function get_comment_text() {