WordPress.org

Make WordPress Core

Ticket #4865: i18n.#4865.patch

File i18n.#4865.patch, 2.1 KB (added by darkdragon, 13 years ago)

Fixes two functions to use new wp_counted_string function

  • comment-template.php

     
    162162        global $id;
    163163        $number = get_comments_number($id);
    164164
    165         if ( $number > 1 )
    166                 $output = str_replace('%', $number, ( false === $more ) ? __('% Comments') : $more);
    167         elseif ( $number == 0 )
    168                 $output = ( false === $zero ) ? __('No Comments') : $zero;
    169         else // must be one
    170                 $output = ( false === $one ) ? __('1 Comment') : $one;
     165        if ( false === $zero )
     166                $zero = __('No Comments');
    171167
     168        if ( false === $one )
     169                $one = __('1 Comment');
     170
     171        if ( false === $more )
     172                $more = __('% Comments');
     173
     174        $output = wp_counted_string($number, $zero, $one, $more);
     175
    172176        echo apply_filters('comments_number', $output, $number);
    173177}
    174178
  • pluggable.php

     
    631631        $notify_message .= sprintf( __('Approve it: %s'),  get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
    632632        $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
    633633        $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
    634         $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";
     634        $strCommentsPending = wp_counted_string( // Suspicion that translatable strings have to be on their own lines.
     635                $comments_waiting,
     636                __('no comments'),
     637                __('1 comment'),
     638                __('% comments')
     639        );
     640        $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
    635641        $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
    636642
    637643        $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title );