Make WordPress Core

Ticket #9111: shorter-ngettext-calls.diff

File shorter-ngettext-calls.diff, 43.5 KB (added by nbachiyski, 16 years ago)
  • wp-includes/formatting.php

     
    14731473                if ($mins <= 1) {
    14741474                        $mins = 1;
    14751475                }
    1476                 $since = sprintf(__ngettext('%s min', '%s mins', $mins), $mins);
     1476                $since = sprintf(_n('%s min', '%s mins', $mins), $mins);
    14771477        } else if (($diff <= 86400) && ($diff > 3600)) {
    14781478                $hours = round($diff / 3600);
    14791479                if ($hours <= 1) {
    14801480                        $hours = 1;
    14811481                }
    1482                 $since = sprintf(__ngettext('%s hour', '%s hours', $hours), $hours);
     1482                $since = sprintf(_n('%s hour', '%s hours', $hours), $hours);
    14831483        } elseif ($diff >= 86400) {
    14841484                $days = round($diff / 86400);
    14851485                if ($days <= 1) {
    14861486                        $days = 1;
    14871487                }
    1488                 $since = sprintf(__ngettext('%s day', '%s days', $days), $days);
     1488                $since = sprintf(_n('%s day', '%s days', $days), $days);
    14891489        }
    14901490        return $since;
    14911491}
  • wp-includes/pluggable.php

     
    10381038        $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
    10391039        $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
    10401040
    1041         $notify_message .= sprintf( __ngettext('Currently %s comment is waiting for approval. Please visit the moderation panel:',
     1041        $notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
    10421042                'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
    10431043        $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n";
    10441044
  • wp-includes/category-template.php

     
    598598 * @return string text for the tooltip of a tag link.
    599599 */
    600600function default_topic_count_text( $count ) {
    601         return sprintf( __ngettext('%s topic', '%s topics', $count), number_format_i18n( $count ) );
     601        return sprintf( _n('%s topic', '%s topics', $count), number_format_i18n( $count ) );
    602602}
    603603
    604604/**
     
    638638
    639639        if ( !isset( $args['topic_count_text_callback'] ) && isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) {
    640640                $body = 'return sprintf (
    641                         __ngettext('.var_export($args['single_text'], true).', '.var_export($args['multiple_text'], true).', $count),
     641                        _n('.var_export($args['single_text'], true).', '.var_export($args['multiple_text'], true).', $count),
    642642                        number_format_i18n( $count ));';
    643643                $args['topic_count_text_callback'] = create_function('$count', $body);
    644644        }
  • wp-admin/users.php

     
    202202                case 'del':
    203203                case 'del_many':
    204204                        $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0;
    205                         $messages[] = '<div id="message" class="updated fade"><p>' . sprintf(__ngettext('%s user deleted', '%s users deleted', $delete_count), $delete_count) . '</p></div>';
     205                        $messages[] = '<div id="message" class="updated fade"><p>' . sprintf(_n('%s user deleted', '%s users deleted', $delete_count), $delete_count) . '</p></div>';
    206206                        break;
    207207                case 'add':
    208208                        $messages[] = '<div id="message" class="updated fade"><p>' . __('New user created.') . '</p></div>';
     
    264264
    265265$current_role = false;
    266266$class = empty($role) ? ' class="current"' : '';
    267 $role_links[] = "<li><a href='users.php'$class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users ), number_format_i18n( $total_users ) ) . '</a>';
     267$role_links[] = "<li><a href='users.php'$class>" . sprintf( _n( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users ), number_format_i18n( $total_users ) ) . '</a>';
    268268foreach ( $wp_roles->get_names() as $this_role => $name ) {
    269269        if ( !isset($avail_roles[$this_role]) )
    270270                continue;
  • wp-admin/edit-comments.php

     
    109109                echo '<div id="moderated" class="updated fade"><p>';
    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                }
    125125
     
    136136//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
    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"' : '';
    145145// $status_links[] = "<li><a href='edit-comments.php'$class>" . __( 'All' ) . '</a>';
     
    163163                $link = add_query_arg( 's', attribute_escape( stripslashes( $_GET['s'] ) ), $link );
    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>';
    169169}
  • wp-admin/includes/plugin-install.php

     
    338338                                <td class="name"><?php echo $title; ?></td>
    339339                                <td class="vers"><?php echo $version; ?></td>
    340340                                <td class="vers">
    341                                         <div class="star-holder" title="<?php printf(__ngettext('(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings']), number_format_i18n($plugin['num_ratings'])) ?>">
     341                                        <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings']), number_format_i18n($plugin['num_ratings'])) ?>">
    342342                                                <div class="star star-rating" style="width: <?php echo attribute_escape($plugin['rating']) ?>px"></div>
    343343                                                <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
    344344                                                <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
     
    485485<?php endif; if ( ! empty($api->tested) ) : ?>
    486486                        <li><strong><?php _e('Compatible up to:') ?></strong> <?php echo $api->tested ?></li>
    487487<?php endif; if ( ! empty($api->downloaded) ) : ?>
    488                         <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(__ngettext('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
     488                        <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
    489489<?php endif; if ( ! empty($api->slug) ) : ?>
    490490                        <li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page &#187;') ?></a></li>
    491491<?php endif; if ( ! empty($api->homepage) ) : ?>
     
    493493<?php endif; ?>
    494494                </ul>
    495495                <h2><?php _e('Average Rating') ?></h2>
    496                 <div class="star-holder" title="<?php printf(__ngettext('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
     496                <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
    497497                        <div class="star star-rating" style="width: <?php echo attribute_escape($api->rating) ?>px"></div>
    498498                        <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
    499499                        <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
     
    501501                        <div class="star star2"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('2 stars') ?>" /></div>
    502502                        <div class="star star1"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('1 star') ?>" /></div>
    503503                </div>
    504                 <small><?php printf(__ngettext('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
     504                <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
    505505        </div>
    506506        <div id="section-holder" class="wrap">
    507507        <?php
  • wp-admin/includes/post.php

     
    774774        $q['m']   = isset($q['m']) ? (int) $q['m'] : 0;
    775775        $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
    776776        $post_stati  = array(   //      array( adj, noun )
    777                                 'publish' => array(__('Published'), __('Published posts'), __ngettext_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')),
    778                                 'future' => array(__('Scheduled'), __('Scheduled posts'), __ngettext_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')),
    779                                 'pending' => array(__('Pending Review'), __('Pending posts'), __ngettext_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
    780                                 'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
    781                                 'private' => array(__('Private'), __('Private posts'), __ngettext_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
     777                                'publish' => array(__('Published'), __('Published posts'), _n_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')),
     778                                'future' => array(__('Scheduled'), __('Scheduled posts'), _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')),
     779                                'pending' => array(__('Pending Review'), __('Pending posts'), _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
     780                                'draft' => array(__('Draft'), _c('Drafts|manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
     781                                'private' => array(__('Private'), __('Private posts'), _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
    782782                        );
    783783
    784784        $post_stati = apply_filters('post_stati', $post_stati);
     
    840840        $q['post_status'] = 'any';
    841841        $q['posts_per_page'] = 15;
    842842        $post_mime_types = array(       //      array( adj, noun )
    843                                 'image' => array(__('Images'), __('Manage Images'), __ngettext_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
    844                                 'audio' => array(__('Audio'), __('Manage Audio'), __ngettext_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
    845                                 'video' => array(__('Video'), __('Manage Video'), __ngettext_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
     843                                'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
     844                                'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
     845                                'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
    846846                        );
    847847        $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
    848848
  • wp-admin/includes/dashboard.php

     
    181181
    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>";
    187187                $text = "<a href='edit.php'>$text</a>";
     
    190190        echo '<td class="t posts">' . $text . '</td>';
    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 = '';
    205205        }
     
    207207
    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>";
    213213                $text = "<a href='edit-comments.php'>$text</a>";
     
    219219
    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>";
    225225                $text = "<a href='edit-pages.php'>$text</a>";
     
    241241
    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>";
    247247                $text = "<a href='categories.php'>$text</a>";
     
    251251
    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>";
    257257                $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
     
    263263
    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>";
    269269                $text = "<a href='edit-tags.php'>$text</a>";
     
    273273
    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>";
    279279                $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>";
     
    294294        echo "\n\t<p>";
    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
    302302        echo '</p>';
  • wp-admin/includes/theme-install.php

     
    469469<?php endif; if ( ! empty($api->tested) ) : ?>
    470470                        <li><strong><?php _e('Compatible up to:') ?></strong> <?php echo $api->tested ?></li>
    471471<?php endif; if ( ! empty($api->downloaded) ) : ?>
    472                         <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(__ngettext('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
     472                        <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
    473473<?php endif; if ( ! empty($api->slug) ) : ?>
    474474                        <li><a target="_blank" href="http://wordpress.org/extend/themes/<?php echo $api->slug ?>/"><?php _e('WordPress.org Theme Page &#187;') ?></a></li>
    475475<?php endif; if ( ! empty($api->homepage) ) : ?>
     
    477477<?php endif; ?>
    478478                </ul>
    479479                <h2><?php _e('Average Rating') ?></h2>
    480                 <div class="star-holder" title="<?php printf(__ngettext('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
     480                <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
    481481                        <div class="star star-rating" style="width: <?php echo attribute_escape($api->rating) ?>px"></div>
    482482                        <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
    483483                        <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
     
    485485                        <div class="star star2"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('2 stars') ?>" /></div>
    486486                        <div class="star star1"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('1 star') ?>" /></div>
    487487                </div>
    488                 <small><?php printf(__ngettext('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
     488                <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
    489489        </div>
    490490        <div id="section-holder" class="wrap">
    491491        <?php
  • wp-admin/includes/media.php

     
    16901690        if ( wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
    16911691                $class = ' class="current"';
    16921692
    1693         $type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf(__ngettext($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
     1693        $type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf(_n($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
    16941694}
    16951695echo implode(' | </li>', $type_links) . '</li>';
    16961696unset($type_links);
  • wp-admin/import/btt.php

     
    8383                        return false;
    8484                } else {
    8585                        $count = count($metakeys);
    86                         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>';
     86                        echo '<p>' . sprintf( _n('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
    8787                        echo '<ul>';
    8888                        foreach ( $metakeys as $post_meta ) {
    8989                                if ( $post_meta->meta_value != '' ) {
  • wp-admin/import/jkw.php

     
    9898                        return false;
    9999                } else {
    100100                        $count = count($metakeys);
    101                         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>';
     101                        echo '<p>' . sprintf( _n('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
    102102                        echo '<ul>';
    103103                        foreach ( $metakeys as $post_meta ) {
    104104                                if ( $post_meta->meta_value != '' ) {
     
    139139                        return false;
    140140                } else {
    141141                        $count = count($metakeys);
    142                         echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
     142                        echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
    143143                        echo '<ul>';
    144144                        foreach ( $metakeys as $post_meta ) {
    145145                                $keyword = addslashes(trim($post_meta->tag_name));
  • wp-admin/import/dotclear.php

     
    312312
    313313                        // Store category translation for future use
    314314                        add_option('dccat2wpcat',$dccat2wpcat);
    315                         echo '<p>'.sprintf(__ngettext('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
     315                        echo '<p>'.sprintf(_n('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
    316316                        return true;
    317317                }
    318318                echo __('No Categories to Import!');
     
    613613                        }
    614614                        add_option('dclinks2wplinks',$dclinks2wplinks);
    615615                        echo '<p>';
    616                         printf(__ngettext('Done! <strong>%s</strong> link or link category imported.', 'Done! <strong>%s</strong> links or link categories imported.', $count), $count);
     616                        printf(_n('Done! <strong>%s</strong> link or link category imported.', 'Done! <strong>%s</strong> links or link categories imported.', $count), $count);
    617617                        echo '<br /><br /></p>';
    618618                        return true;
    619619                }
  • wp-admin/import/blogware.php

     
    155155                        }
    156156                        if ( $num_comments ) {
    157157                                echo ' ';
    158                                 printf( __ngettext('%s comment', '%s comments', $num_comments), $num_comments );
     158                                printf( _n('%s comment', '%s comments', $num_comments), $num_comments );
    159159                        }
    160160                        echo '</li>';
    161161                        flush();
  • wp-admin/import/stp.php

     
    8888
    8989                        add_option('stpimp_posts', $posts);
    9090                        $count = count($posts);
    91                         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>';
     91                        echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
    9292                }
    9393
    9494                echo '<form action="admin.php?import=stp&amp;step=2" method="post">';
     
    106106                // run that funky magic!
    107107                $tags_added = $this->tag2post();
    108108
    109                 echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag was added!', 'Done! <strong>%s</strong> tags were added!', $tags_added), $tags_added ) . '<br /></p>';
     109                echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag was added!', 'Done! <strong>%s</strong> tags were added!', $tags_added), $tags_added ) . '<br /></p>';
    110110                echo '<form action="admin.php?import=stp&amp;step=3" method="post">';
    111111                wp_nonce_field('import-stp');
    112112                echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 3').'" /></p>';
  • wp-admin/import/wp-cat2tag.php

     
    6565
    6666                if ( $cat_num > 0 ) {
    6767                        screen_icon();
    68                         echo '<h2>' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>';
     68                        echo '<h2>' . sprintf( _n( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>';
    6969                        echo '<div class="narrow">';
    7070                        echo '<p>' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';
    7171                        echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p></div>';
     
    141141
    142142                if ( $tags_num > 0 ) {
    143143                        screen_icon();
    144                         echo '<h2>' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>';
     144                        echo '<h2>' . sprintf( _n( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>';
    145145                        echo '<div class="narrow">';
    146146                        echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
    147147                        echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>';
  • wp-admin/import/utw.php

     
    9898
    9999                        $count = count($tags);
    100100
    101                         echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
     101                        echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
    102102                        echo '<p>' . __('The following tags were found:') . '</p>';
    103103
    104104                        echo '<ul>';
     
    150150
    151151                        $count = count($posts);
    152152
    153                         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>';
     153                        echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
    154154
    155155                }
    156156
     
    171171                // run that funky magic!
    172172                $tags_added = $this->tag2post();
    173173
    174                 echo '<p>' . sprintf( __ngettext( 'Done! <strong>%s</strong> tag were added!', 'Done! <strong>%s</strong> tags were added!', $tags_added ), $tags_added ) . '<br /></p>';
     174                echo '<p>' . sprintf( _n( 'Done! <strong>%s</strong> tag were added!', 'Done! <strong>%s</strong> tags were added!', $tags_added ), $tags_added ) . '<br /></p>';
    175175
    176176                echo '<form action="admin.php?import=utw&amp;step=4" method="post">';
    177177                wp_nonce_field('import-utw');
  • wp-admin/import/mt.php

     
    288288                }
    289289
    290290                if ( $num_comments )
    291                         printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
     291                        printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments);
    292292
    293293                $num_pings = 0;
    294294                foreach ( $pings as $ping ) {
     
    305305                }
    306306
    307307                if ( $num_pings )
    308                         printf(' '.__ngettext('(%s ping)', '(%s pings)', $num_pings), $num_pings);
     308                        printf(' '._n('(%s ping)', '(%s pings)', $num_pings), $num_pings);
    309309
    310310                echo "</li>";
    311311                //ob_flush();flush();
  • wp-admin/import/textpattern.php

     
    201201
    202202                        // Store category translation for future use
    203203                        add_option('txpcat2wpcat',$txpcat2wpcat);
    204                         echo '<p>'.sprintf(__ngettext('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
     204                        echo '<p>'.sprintf(_n('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
    205205                        return true;
    206206                }
    207207                echo __('No Categories to Import!');
     
    486486                        }
    487487                        add_option('txplinks2wplinks',$txplinks2wplinks);
    488488                        echo '<p>';
    489                         printf(__ngettext('Done! <strong>%s</strong> link imported', 'Done! <strong>%s</strong> links imported', $count), $count);
     489                        printf(_n('Done! <strong>%s</strong> link imported', 'Done! <strong>%s</strong> links imported', $count), $count);
    490490                        echo '<br /><br /></p>';
    491491                        return true;
    492492                }
  • wp-admin/import/greymatter.php

     
    283283                                }
    284284                                if ($numAddedComments > 0) {
    285285                                        echo ': ';
    286                                 printf( __ngettext('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments);
     286                                printf( _n('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments);
    287287                                }
    288288                                $preExisting = $numComments - numAddedComments;
    289289                                if ($preExisting > 0) {
    290290                                        echo ' ';
    291                                         printf( __ngettext( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting);
     291                                        printf( _n( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting);
    292292                                }
    293293                        }
    294294                        echo '... <strong>'.__('Done').'</strong></li>';
  • wp-admin/import/wordpress.php

     
    528528                } }
    529529
    530530                if ( $num_comments )
    531                         printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
     531                        printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments);
    532532
    533533                // Now for post meta
    534534                preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
  • wp-admin/upload.php

     
    121121        }
    122122
    123123        $post_mime_types = array(
    124                                 'image' => array(__('Images'), __('Manage Images'), __ngettext_noop('Image (%s)', 'Images (%s)')),
    125                                 'audio' => array(__('Audio'), __('Manage Audio'), __ngettext_noop('Audio (%s)', 'Audio (%s)')),
    126                                 'video' => array(__('Video'), __('Manage Video'), __ngettext_noop('Video (%s)', 'Video (%s)')),
     124                                'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')),
     125                                'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')),
     126                                'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')),
    127127                        );
    128128        $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
    129129
     
    147147
    148148if ( isset($_GET['attached']) && (int) $_GET['attached'] ) {
    149149        $attached = (int) $_GET['attached'];
    150         $message = sprintf( __ngettext('Reattached %d attachment', 'Reattached %d attachments', $attached), $attached );
     150        $message = sprintf( _n('Reattached %d attachment', 'Reattached %d attachments', $attached), $attached );
    151151        $_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']);
    152152}
    153153
     
    188188                $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
    189189
    190190$class = empty($_GET['post_mime_type']) && ! isset($_GET['detached']) ? ' class="current"' : '';
    191 $type_links[] = "<li><a href='upload.php'$class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts ), number_format_i18n( $_total_posts ) ) . '</a>';
     191$type_links[] = "<li><a href='upload.php'$class>" . sprintf( _n( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts ), number_format_i18n( $_total_posts ) ) . '</a>';
    192192foreach ( $post_mime_types as $mime_type => $label ) {
    193193        $class = '';
    194194
     
    198198        if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
    199199                $class = ' class="current"';
    200200
    201         $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
     201        $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
    202202}
    203203$class = isset($_GET['detached']) ? ' class="current"' : '';
    204204$type_links[] = '<li><a href="upload.php?detached=1"' . $class . '>' . __('Unattached') . '</a>';
  • wp-admin/edit.php

     
    110110<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
    111111<div id="message" class="updated fade"><p>
    112112<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
    113         printf( __ngettext( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
     113        printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
    114114        unset($_GET['updated']);
    115115}
    116116
     
    118118        unset($_GET['skipped']);
    119119
    120120if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
    121         printf( __ngettext( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
     121        printf( _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
    122122        unset($_GET['locked']);
    123123}
    124124
    125125if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
    126         printf( __ngettext( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
     126        printf( _n( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
    127127        unset($_GET['deleted']);
    128128}
    129129
     
    141141$num_posts = wp_count_posts( 'post', 'readable' );
    142142$total_posts = array_sum( (array) $num_posts );
    143143$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
    144 $status_links[] = "<li><a href='edit.php' $class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
     144$status_links[] = "<li><a href='edit.php' $class>" . sprintf( _n( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
    145145
    146146
    147147foreach ( $post_stati as $status => $label ) {
     
    155155        if ( isset($_GET['post_status']) && $status == $_GET['post_status'] )
    156156                $class = ' class="current"';
    157157
    158         $status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
     158        $status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
    159159}
    160160echo implode( " |</li>\n", $status_links ) . '</li>';
    161161unset( $status_links );
  • wp-admin/link-manager.php

     
    8080if ( isset($_GET['deleted']) ) {
    8181        echo '<div id="message" class="updated fade"><p>';
    8282        $deleted = (int) $_GET['deleted'];
    83         printf(__ngettext('%s link deleted.', '%s links deleted', $deleted), $deleted);
     83        printf(_n('%s link deleted.', '%s links deleted', $deleted), $deleted);
    8484        echo '</p></div>';
    8585        $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
    8686}
  • wp-admin/widgets.php

     
    192192
    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
    200200$sidebar_info_text = sprintf( wp_specialchars( $sidebar_info_text ), "<span id='widget-count'>$sidebar_widget_count</span>", $wp_registered_sidebars[$sidebar]['name'] );
  • wp-admin/edit-pages.php

     
    112112<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
    113113<div id="message" class="updated fade"><p>
    114114<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
    115         printf( __ngettext( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
     115        printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
    116116        unset($_GET['updated']);
    117117}
    118118
    119119if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) {
    120         printf( __ngettext( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
     120        printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
    121121        unset($_GET['skipped']);
    122122}
    123123
    124124if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
    125         printf( __ngettext( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
     125        printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
    126126        unset($_GET['locked']);
    127127}
    128128
    129129if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
    130         printf( __ngettext( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
     130        printf( _n( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
    131131        unset($_GET['deleted']);
    132132}
    133133$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
     
    150150$num_posts = wp_count_posts('page', 'readable');
    151151$total_posts = array_sum( (array) $num_posts );
    152152$class = empty($_GET['post_status']) ? ' class="current"' : '';
    153 $status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
     153$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( _n( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
    154154foreach ( $post_stati as $status => $label ) {
    155155        $class = '';
    156156