Skip to content

Commit 603ec78

Browse files
committed
i18n fix for comments_number(). Props Mark Jaquith. fixes WordPress#3244
git-svn-id: https://develop.svn.wordpress.org/trunk@4494 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7b7647c commit 603ec78

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

wp-includes/comment-template.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,18 @@ function get_comments_number( $post_id = 0 ) {
161161
return apply_filters('get_comments_number', $count);
162162
}
163163

164-
function comments_number( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $number = '' ) {
165-
global $id, $comment;
166-
$number = get_comments_number( $id );
167-
if ($number == 0) {
168-
$blah = $zero;
169-
} elseif ($number == 1) {
170-
$blah = $one;
171-
} elseif ($number > 1) {
172-
$blah = str_replace('%', $number, $more);
173-
}
174-
echo apply_filters('comments_number', $blah);
164+
function comments_number( $zero = false, $one = false, $more = false, $number = '' ) {
165+
global $id;
166+
$number = get_comments_number($id);
167+
168+
if ( $number > 1 )
169+
$output = str_replace('%', $number, ( false === $more ) ? __('% Comments') : $more);
170+
elseif ( $number == 0 )
171+
$output = ( false === $zero ) ? __('No Comments') : $zero;
172+
else // must be one
173+
$output = ( false === $one ) ? __('1 Comment') : $one;
174+
175+
echo apply_filters('comments_number', $output, $number);
175176
}
176177

177178
function get_comment_text() {

0 commit comments

Comments
 (0)