WordPress.org

Make WordPress Core

Changeset 10605


Ignore:
Timestamp:
02/20/09 19:22:34 (7 years ago)
Author:
ryan
Message:

Use _n(). Props mrmist. fixes #9190

Location:
trunk/wp-admin
Files:
3 edited

Legend:

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

    r10438 r10605  
    110110 
    111111        if ( $approved > 0 ) { 
    112             printf( __ngettext( '%s comment approved', '%s comments approved', $approved ), $approved ); 
     112            printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved ); 
    113113            echo '<br />'; 
    114114        } 
    115115 
    116116        if ( $deleted > 0 ) { 
    117             printf( __ngettext( '%s comment deleted', '%s comments deleted', $deleted ), $deleted ); 
     117            printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted ); 
    118118            echo '<br />'; 
    119119        } 
    120120 
    121121        if ( $spam > 0 ) { 
    122             printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); 
     122            printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam ); 
    123123            echo '<br />'; 
    124124        } 
     
    137137//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>") 
    138138$stati = array( 
    139         'all' => __ngettext_noop('All', 'All'), // singular not used 
    140         'moderated' => __ngettext_noop('Pending (<span class="pending-count">%s</span>)', 'Pending (<span class="pending-count">%s</span>)'), 
    141         'approved' => __ngettext_noop('Approved', 'Approved'), // singular not used 
    142         'spam' => __ngettext_noop('Spam (<span class="spam-count">%s</span>)', 'Spam (<span class="spam-count">%s</span>)') 
     139        'all' => _n_noop('All', 'All'), // singular not used 
     140        'moderated' => _n_noop('Pending (<span class="pending-count">%s</span>)', 'Pending (<span class="pending-count">%s</span>)'), 
     141        'approved' => _n_noop('Approved', 'Approved'), // singular not used 
     142        'spam' => _n_noop('Spam (<span class="spam-count">%s</span>)', 'Spam (<span class="spam-count">%s</span>)') 
    143143    ); 
    144144$class = ( '' === $comment_status ) ? ' class="current"' : ''; 
     
    164164    */ 
    165165    $status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf( 
    166         __ngettext( $label[0], $label[1], $num_comments->$status ), 
     166        _n( $label[0], $label[1], $num_comments->$status ), 
    167167        number_format_i18n( $num_comments->$status ) 
    168168    ) . '</a>'; 
  • trunk/wp-admin/includes/dashboard.php

    r10564 r10605  
    182182    // Posts 
    183183    $num = number_format_i18n( $num_posts->publish ); 
    184     $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) ); 
     184    $text = _n( 'Post', 'Posts', intval($num_posts->publish) ); 
    185185    if ( current_user_can( 'edit_posts' ) ) { 
    186186        $num = "<a href='edit.php'>$num</a>"; 
     
    191191    /* TODO: Show status breakdown on hover 
    192192    if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can 
    193         $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>'; 
     193        $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( _n( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>'; 
    194194    } 
    195195    if ( $can_edit_posts && !empty($num_posts->draft) ) { 
    196         $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>'; 
     196        $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( _n( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>'; 
    197197    } 
    198198    if ( $can_edit_posts && !empty($num_posts->future) ) { 
    199         $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>'; 
     199        $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( _n( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>'; 
    200200    } 
    201201    if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) { 
    202         $pending_text = sprintf( __ngettext( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) ); 
     202        $pending_text = sprintf( _n( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) ); 
    203203    } else { 
    204204        $pending_text = ''; 
     
    208208    // Total Comments 
    209209    $num = number_format_i18n($num_comm->total_comments); 
    210     $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments ); 
     210    $text = _n( 'Comment', 'Comments', $num_comm->total_comments ); 
    211211    if ( current_user_can( 'moderate_comments' ) ) { 
    212212        $num = "<a href='edit-comments.php'>$num</a>"; 
     
    220220    // Pages 
    221221    $num = number_format_i18n( $num_pages->publish ); 
    222     $text = __ngettext( 'Page', 'Pages', $num_pages->publish ); 
     222    $text = _n( 'Page', 'Pages', $num_pages->publish ); 
    223223    if ( current_user_can( 'edit_pages' ) ) { 
    224224        $num = "<a href='edit-pages.php'>$num</a>"; 
     
    242242    // Categories 
    243243    $num = number_format_i18n( $num_cats ); 
    244     $text = __ngettext( 'Category', 'Categories', $num_cats ); 
     244    $text = _n( 'Category', 'Categories', $num_cats ); 
    245245    if ( current_user_can( 'manage_categories' ) ) { 
    246246        $num = "<a href='categories.php'>$num</a>"; 
     
    252252    // Pending Comments 
    253253    $num = number_format_i18n($num_comm->moderated); 
    254     $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated ); 
     254    $text = _n( 'Pending', 'Pending', $num_comm->moderated ); 
    255255    if ( current_user_can( 'moderate_comments' ) ) { 
    256256        $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>"; 
     
    264264    // Tags 
    265265    $num = number_format_i18n( $num_tags ); 
    266     $text = __ngettext( 'Tag', 'Tags', $num_tags ); 
     266    $text = _n( 'Tag', 'Tags', $num_tags ); 
    267267    if ( current_user_can( 'manage_categories' ) ) { 
    268268        $num = "<a href='edit-tags.php'>$num</a>"; 
     
    274274    // Spam Comments 
    275275    $num = number_format_i18n($num_comm->spam); 
    276     $text = __ngettext( 'Spam', 'Spam', $num_comm->spam ); 
     276    $text = _n( 'Spam', 'Spam', $num_comm->spam ); 
    277277    if ( current_user_can( 'moderate_comments' ) ) { 
    278278        $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; 
     
    295295    if ( current_user_can( 'switch_themes' ) ) { 
    296296        echo '<a href="themes.php" class="button rbutton">' . __('Change Theme') . '</a>'; 
    297         printf(__ngettext('Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $ct->title, $num); 
     297        printf(_n('Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $ct->title, $num); 
    298298    } else { 
    299         printf(__ngettext('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $ct->title, $num); 
     299        printf(_n('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $ct->title, $num); 
    300300    } 
    301301 
  • trunk/wp-admin/widgets.php

    r10150 r10605  
    193193// This is sort of lame since "widget" won't be converted to "widgets" in the JS 
    194194if ( 1 < $sidebars_count = count($wp_registered_sidebars) ) 
    195     $sidebar_info_text = __ngettext( 'You are using %1$s widget in the "%2$s" sidebar.', 'You are using %1$s widgets in the "%2$s" sidebar.', $sidebar_widget_count ); 
     195    $sidebar_info_text = _n( 'You are using %1$s widget in the "%2$s" sidebar.', 'You are using %1$s widgets in the "%2$s" sidebar.', $sidebar_widget_count ); 
    196196else 
    197     $sidebar_info_text = __ngettext( 'You are using %1$s widget in the sidebar.', 'You are using %1$s widgets in the sidebar.', $sidebar_widget_count ); 
     197    $sidebar_info_text = _n( 'You are using %1$s widget in the sidebar.', 'You are using %1$s widgets in the sidebar.', $sidebar_widget_count ); 
    198198 
    199199 
Note: See TracChangeset for help on using the changeset viewer.