Make WordPress Core

Changeset 6430


Ignore:
Timestamp:
12/20/2007 05:05:06 PM (17 years ago)
Author:
ryan
Message:

Use ngettext() for plurals. Props darkdragon. see #4865

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r6277 r6430  
    6969    echo '<div style="background-color: rgb(207, 235, 247);" id="message" class="updated fade"><p>';
    7070    if ( !empty( $_POST['spam_button'] ) ) {
    71         printf(__ngettext('%s comment marked as spam', '%s comments marked as spam.', $i), $i);
     71        printf(__ngettext('%s comment marked as spam.', '%s comments marked as spam.', $i), $i);
    7272    } else {
    7373        printf(__ngettext('%s comment deleted.', '%s comments deleted.', $i), $i);
  • trunk/wp-admin/import/blogware.php

    r6125 r6430  
    142142            if ( $num_comments ) {
    143143                echo ' ';
    144                 printf(__('(%s comments)'), $num_comments);
     144                printf( __ngettext('%s comment', '%s comments', $num_comments), $num_comments );
    145145            }
    146146            echo '</li>';
  • trunk/wp-admin/import/btt.php

    r6423 r6430  
    6969        } else {
    7070            $count = count($metakeys);
    71             echo '<p>' . sprintf( __('Done! <strong>%s</strong> posts with tags were read.'), $count ) . '<br /></p>';
     71            echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
    7272            echo '<ul>';
    7373            foreach ( $metakeys as $post_meta ) {
  • trunk/wp-admin/import/dotclear.php

    r6125 r6430  
    527527            add_option('dclinks2wplinks',$dclinks2wplinks);
    528528            echo '<p>';
    529             printf(__('Done! <strong>%s</strong> links or link categories imported'), $count);
     529            printf(__ngettext('Done! <strong>%s</strong> link or link category imported.', 'Done! <strong>%s</strong> links or link categories imported.', $count), $count);
    530530            echo '<br /><br /></p>';
    531531            return true;
  • trunk/wp-admin/import/greymatter.php

    r6125 r6430  
    273273                if ($numAddedComments > 0) {
    274274                    echo ': ';
    275                     printf(__('imported %d comment(s)'), $numAddedComments);
     275                printf(__('imported %s'), sprintf( __ngettext('%s comment', '%s comments', $numAddedComments) , $numAddedComments) );
    276276                }
    277277                $preExisting = $numComments - numAddedComments;
    278278                if ($preExisting > 0) {
    279279                    echo ' ';
    280                     printf(__('ignored %d pre-existing comments'), $preExisting);
     280                    printf(__('ignored %s'), sprintf( __ngettext( '%s pre-existing comment', '%s pre-existing comments', $preExisting ) , $preExisting) );
    281281                }
    282282            }
  • trunk/wp-admin/import/jkw.php

    r6423 r6430  
    8585        } else {
    8686            $count = count($metakeys);
    87             echo '<p>' . sprintf( __('Done! <strong>%s</strong> posts with tags were read.'), $count ) . '<br /></p>';
     87            echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
    8888            echo '<ul>';
    8989            foreach ( $metakeys as $post_meta ) {
     
    126126        } else {
    127127            $count = count($metakeys);
    128             echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
     128            echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
    129129            echo '<ul>';
    130130            foreach ( $metakeys as $post_meta ) {
  • trunk/wp-admin/import/livejournal.php

    r6125 r6430  
    120120            if ( $num_comments ) {
    121121                echo ' ';
    122                 printf(__('(%s comments)'), $num_comments);
     122                printf(__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
    123123            }
    124124            echo '</li>';
  • trunk/wp-admin/import/mt.php

    r6171 r6430  
    239239
    240240        if ( $num_comments )
    241             printf(' '.__('(%s comments)'), $num_comments);
     241            printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
    242242
    243243        $num_pings = 0;
     
    256256
    257257        if ( $num_pings )
    258             printf(' '.__('(%s pings)'), $num_pings);
     258            printf(' '.__ngettext('(%s ping)', '(%s pings)', $num_pings), $num_pings);
    259259
    260260        echo "</li>";
  • trunk/wp-admin/import/stp.php

    r6423 r6430  
    7474            add_option('stpimp_posts', $posts);
    7575            $count = count($posts);
    76             echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>';
     76            echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
    7777        }
    7878
     
    9292        $tags_added = $this->tag2post();
    9393       
    94         echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>';
     94        echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tags where added!', 'Done! <strong>%s</strong> tags where added!', $tags_added), $tags_added ) . '<br /></p>';
    9595        echo '<form action="admin.php?import=stp&amp;step=3" method="post">';
    9696        wp_nonce_field('import-stp');
  • trunk/wp-admin/import/textpattern.php

    r6125 r6430  
    463463            add_option('txplinks2wplinks',$txplinks2wplinks);
    464464            echo '<p>';
    465             printf(__('Done! <strong>%s</strong> Links imported'), $count);
     465            printf(__ngettext('Done! <strong>%s</strong> link imported', 'Done! <strong>%s</strong> links imported', $count), $count);
    466466            echo '<br /><br /></p>';
    467467            return true;
  • trunk/wp-admin/import/utw.php

    r6423 r6430  
    8585            $count = count($tags);
    8686
    87             echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>';
     87            echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
    8888            echo '<p>' . __('The following tags were found:') . '</p>';
    8989
     
    137137            $count = count($posts);
    138138
    139             echo '<p>' . sprintf( __('Done! <strong>%s</strong> tag to post relationships were read.'), $count ) . '<br /></p>';
     139            echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
    140140
    141141        }
     
    158158        $tags_added = $this->tag2post();
    159159
    160         echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were added!'), $tags_added ) . '<br /></p>';
     160        echo '<p>' . sprintf( __ngettext( 'Done! <strong>%s</strong> tag were added!', 'Done! <strong>%s</strong> tags were added!', $tags_added ), $tags_added ) . '<br /></p>';
    161161
    162162        echo '<form action="admin.php?import=utw&amp;step=4" method="post">';
  • trunk/wp-admin/import/wordpress.php

    r6428 r6430  
    430430
    431431        if ( $num_comments )
    432             printf(' '.__('(%s comments)'), $num_comments);
     432            printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
    433433
    434434        // Now for post meta
  • trunk/wp-admin/moderation.php

    r6298 r6430  
    8383
    8484        if ( $approved > 0 ) {
    85             printf( __ngettext( '%s comment approved.', '%s comments approved.', $approved ), $approved );
     85            printf( __ngettext( '%s comment approved', '%s comments approved', $approved ), $approved );
    8686            echo '<br />';
    8787        }
    8888
    8989        if ( $deleted > 0 ) {
    90             printf( __ngettext( '%s comment deleted', '%s comments deleted.', $deleted ), $deleted );
     90            printf( __ngettext( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
    9191            echo '<br />';
    9292        }
  • trunk/wp-includes/pluggable.php

    r6400 r6430  
    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 = sprintf( __ngettext('%s comment', '%s comments', $comments_waiting), $comments_waiting );
     635    $notify_message .= sprintf( __('Currently %s are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
    635636    $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
    636637
Note: See TracChangeset for help on using the changeset viewer.