Make WordPress Core

Changeset 4494


Ignore:
Timestamp:
11/19/2006 07:45:28 AM (17 years ago)
Author:
ryan
Message:

i18n fix for comments_number(). Props Mark Jaquith. fixes #3244

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r4144 r4494  
    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);
     164function 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
Note: See TracChangeset for help on using the changeset viewer.