WordPress.org

Make WordPress Core

Ticket #9190: dashboard.diff

File dashboard.diff, 6.0 KB (added by mrmist, 9 years ago)

dashboard patch

  • 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>';