Make WordPress Core

Ticket #28502: 28502.3.diff

File 28502.3.diff, 19.5 KB (added by SergeyBiryukov, 10 years ago)
  • src/wp-admin/edit.php

     
    247247$bulk_messages = array();
    248248$bulk_messages['post'] = array(
    249249        'updated'   => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
    250         'locked'    => _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
     250        'locked'    => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :
     251                           _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
    251252        'deleted'   => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
    252253        'trashed'   => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
    253254        'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
     
    254255);
    255256$bulk_messages['page'] = array(
    256257        'updated'   => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
    257         'locked'    => _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
     258        'locked'    => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :
     259                           _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
    258260        'deleted'   => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
    259261        'trashed'   => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
    260262        'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
  • src/wp-admin/includes/ajax-actions.php

     
    379379                // Here for completeness - not used.
    380380                'id' => $comment_id,
    381381                'supplemental' => array(
    382                         'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ),
     382                        'total_items_i18n' => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),
    383383                        'total_pages' => ceil( $total / $per_page ),
    384384                        'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
    385385                        'total' => $total,
  • src/wp-admin/network.php

     
    413413                }
    414414                $num_keys_salts = count( $keys_salts );
    415415?>
    416         <p><?php
    417                 echo _n( 'This unique authentication key is also missing from your <code>wp-config.php</code> file.', 'These unique authentication keys are also missing from your <code>wp-config.php</code> file.', $num_keys_salts ); ?> <?php _e( 'To make your installation more secure, you should also add:' ) ?></p>
     416        <p>
     417                <?php
     418                        if ( 1 == $num_keys_salts ) {
     419                                _e( 'This unique authentication key is also missing from your <code>wp-config.php</code> file.' );
     420                        } else {
     421                                _e( 'These unique authentication keys are also missing from your <code>wp-config.php</code> file.' );
     422                        }
     423                ?>
     424                <?php _e( 'To make your installation more secure, you should also add:' ); ?>
     425        </p>
    418426        <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
    419427<?php
    420428        }
  • src/wp-admin/network/themes.php

     
    146146                        if ( ! isset( $_REQUEST['verify-delete'] ) ) {
    147147                                wp_enqueue_script( 'jquery' );
    148148                                require_once( ABSPATH . 'wp-admin/admin-header.php' );
     149                                $themes_to_delete = count( $themes );
    149150                                ?>
    150151                        <div class="wrap">
    151                                 <?php
    152                                         $themes_to_delete = count( $themes );
    153                                         echo '<h2>' . _n( 'Delete Theme', 'Delete Themes', $themes_to_delete ) . '</h2>';
    154                                 ?>
    155                                 <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This theme may be active on other sites in the network.', 'These themes may be active on other sites in the network.', $themes_to_delete ); ?></p></div>
    156                                 <p><?php echo _n( 'You are about to remove the following theme:', 'You are about to remove the following themes:', $themes_to_delete ); ?></p>
     152                                <?php if ( 1 == $themes_to_delete ) : ?>
     153                                        <h2><?php _e( 'Delete Theme' ); ?></h2>
     154                                        <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This theme may be active on other sites in the network.' ); ?></p></div>
     155                                        <p><?php _e( 'You are about to remove the following theme:' ); ?></p>
     156                                <?php else : ?>
     157                                        <h2><?php _e( 'Delete Themes' ); ?></h2>
     158                                        <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These themes may be active on other sites in the network.' ); ?></p></div>
     159                                        <p><?php _e( 'You are about to remove the following themes:' ); ?></p>
     160                                <?php endif; ?>
    157161                                        <ul class="ul-disc">
    158162                                        <?php
    159163                                                foreach ( $theme_info as $theme ) {
     
    162166                                                }
    163167                                        ?>
    164168                                        </ul>
    165                                 <p><?php _e('Are you sure you wish to delete these themes?'); ?></p>
     169                                <?php if ( 1 == $themes_to_delete ) : ?>
     170                                        <p><?php _e( 'Are you sure you wish to delete this theme?' ); ?></p>
     171                                <?php else : ?>
     172                                        <p><?php _e( 'Are you sure you wish to delete these themes?' ); ?></p>
     173                                <?php endif; ?>
    166174                                <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;">
    167175                                        <input type="hidden" name="verify-delete" value="1" />
    168176                                        <input type="hidden" name="action" value="delete-selected" />
     
    170178                                                foreach ( (array) $themes as $theme ) {
    171179                                                        echo '<input type="hidden" name="checked[]" value="' . esc_attr($theme) . '" />';
    172180                                                }
     181
     182                                                wp_nonce_field( 'bulk-themes' );
     183
     184                                                if ( 1 == $themes_to_delete ) {
     185                                                        submit_button( __( 'Yes, Delete this theme' ), 'button', 'submit', false );
     186                                                } else {
     187                                                        submit_button( __( 'Yes, Delete these themes' ), 'button', 'submit', false );
     188                                                }
    173189                                        ?>
    174                                         <?php wp_nonce_field('bulk-themes') ?>
    175                                         <?php submit_button( _n( 'Yes, Delete this theme', 'Yes, Delete these themes', $themes_to_delete ), 'button', 'submit', false ); ?>
    176190                                </form>
    177191                                <?php
    178192                                $referer = wp_get_referer();
     
    254268
    255269<?php
    256270if ( isset( $_GET['enabled'] ) ) {
    257         $_GET['enabled'] = absint( $_GET['enabled'] );
    258         echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
     271        $enabled = absint( $_GET['enabled'] );
     272        if ( 1 == $enabled ) {
     273                $message = __( 'Theme enabled.' );
     274        } else {
     275                $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
     276        }
     277        echo '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
    259278} elseif ( isset( $_GET['disabled'] ) ) {
    260         $_GET['disabled'] = absint( $_GET['disabled'] );
    261         echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
     279        $disabled = absint( $_GET['disabled'] );
     280        if ( 1 == $disabled ) {
     281                $message = __( 'Theme disabled.' );
     282        } else {
     283                $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
     284        }
     285        echo '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
    262286} elseif ( isset( $_GET['deleted'] ) ) {
    263         $_GET['deleted'] = absint( $_GET['deleted'] );
    264         echo '<div id="message" class="updated"><p>' . sprintf( _nx( 'Theme deleted.', '%s themes deleted.', $_GET['deleted'], 'network' ), number_format_i18n( $_GET['deleted'] ) ) . '</p></div>';
     287        $deleted = absint( $_GET['deleted'] );
     288        if ( 1 == $deleted ) {
     289                $message = __( 'Theme deleted.' );
     290        } else {
     291                $message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
     292        }
     293        echo '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
    265294} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
    266295        echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
    267296} elseif ( isset( $_GET['error'] ) && 'main' == $_GET['error'] ) {
  • src/wp-admin/network/users.php

     
    2424        ?>
    2525        <h2><?php esc_html_e( 'Users' ); ?></h2>
    2626
    27         <?php if ( count( $users ) > 1 ) : ?>
     27        <?php if ( 1 == count( $users ) ) : ?>
     28                <p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p>
     29        <?php else : ?>
    2830                <p><?php _e( 'You have chosen to delete the following users from all networks and sites.' ); ?></p>
    29         <?php else : ?>
    30                 <p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p>
    3131        <?php endif; ?>
    3232
    3333        <form action="users.php?action=dodelete" method="post">
     
    103103        /** This action is documented in wp-admin/users.php */
    104104        do_action( 'delete_user_form', $current_user );
    105105
    106         if ( count( $users ) > 1 ) : ?>
     106        if ( 1 == count( $users ) ) : ?>
     107                <p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>
     108        <?php else : ?>
    107109                <p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' ); ?></p>
    108         <?php else : ?>
    109                 <p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>
    110110        <?php endif;
    111111
    112112        submit_button( __('Confirm Deletion'), 'delete' );
  • src/wp-admin/plugins.php

     
    283283                                                }
    284284                                        }
    285285                                        $plugins_to_delete = count( $plugin_info );
    286                                         echo '<h2>' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '</h2>';
    287286                                ?>
    288                                 <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
    289                                 <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This plugin may be active on other sites in the network.', 'These plugins may be active on other sites in the network.', $plugins_to_delete ); ?></p></div>
     287                                <?php if ( 1 == $plugins_to_delete ) : ?>
     288                                        <h2><?php _e( 'Delete Plugin' ); ?></h2>
     289                                        <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
     290                                                <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This plugin may be active on other sites in the network.' ); ?></p></div>
     291                                        <?php endif; ?>
     292                                        <p><?php _e( 'You are about to remove the following plugin:' ); ?></p>
     293                                <?php else: ?>
     294                                        <h2><?php _e( 'Delete Plugins' ); ?></h2>
     295                                        <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
     296                                                <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These plugins may be active on other sites in the network.' ); ?></p></div>
     297                                        <?php endif; ?>
     298                                        <p><?php _e( 'You are about to remove the following plugins:' ); ?></p>
    290299                                <?php endif; ?>
    291                                 <p><?php echo _n( 'You are about to remove the following plugin:', 'You are about to remove the following plugins:', $plugins_to_delete ); ?></p>
    292300                                        <ul class="ul-disc">
    293301                                                <?php
    294302                                                $data_to_delete = false;
  • src/wp-admin/upload.php

     
    219219<?php
    220220$message = '';
    221221if ( ! empty( $_GET['posted'] ) ) {
    222         $message = __('Media attachment updated.');
     222        $message = __( 'Media attachment updated.' );
    223223        $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
    224224}
    225225
    226226if ( ! empty( $_GET['attached'] ) && $attached = absint( $_GET['attached'] ) ) {
    227         $message = sprintf( _n('Reattached %d attachment.', 'Reattached %d attachments.', $attached), $attached );
     227        $message = sprintf( _n( 'Reattached %d attachment.', 'Reattached %d attachments.', $attached ), $attached );
    228228        $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'detach', 'attached' ), $_SERVER['REQUEST_URI'] );
    229229}
    230230
     
    234234}
    235235
    236236if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) {
    237         $message = sprintf( _n( 'Media attachment permanently deleted.', '%d media attachments permanently deleted.', $deleted ), number_format_i18n( $_GET['deleted'] ) );
     237        if ( 1 == $deleted ) {
     238                $message = __( 'Media attachment permanently deleted.' );
     239        } else {
     240                $message = _n( '%d media attachment permanently deleted.', '%d media attachments permanently deleted.', $deleted );
     241        }
     242        $message = sprintf( $message, number_format_i18n( $deleted ) );
    238243        $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
    239244}
    240245
    241246if ( ! empty( $_GET['trashed'] ) && $trashed = absint( $_GET['trashed'] ) ) {
    242         $message = sprintf( _n( 'Media attachment moved to the trash.', '%d media attachments moved to the trash.', $trashed ), number_format_i18n( $_GET['trashed'] ) );
     247        if ( 1 == $trashed ) {
     248                $message = __( 'Media attachment moved to the trash.' );
     249        } else {
     250                $message = _n( '%d media attachment moved to the trash.', '%d media attachments moved to the trash.', $trashed );
     251        }
     252        $message = sprintf( $message, number_format_i18n( $trashed ) );
    243253        $message .= ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.(isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo') . '</a>';
    244254        $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']);
    245255}
    246256
    247257if ( ! empty( $_GET['untrashed'] ) && $untrashed = absint( $_GET['untrashed'] ) ) {
    248         $message = sprintf( _n( 'Media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed ), number_format_i18n( $_GET['untrashed'] ) );
     258        if ( 1 == $untrashed ) {
     259                $message = __( 'Media attachment restored from the trash.' );
     260        } else {
     261                $message = _n( '%d media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed );
     262        }
     263        $message = sprintf( $message, number_format_i18n( $untrashed ) );
    249264        $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']);
    250265}
    251266
  • src/wp-admin/users.php

     
    216216<div class="wrap">
    217217<h2><?php _e('Delete Users'); ?></h2>
    218218<?php if ( isset( $_REQUEST['error'] ) ) : ?>
    219 <div class="error">
    220         <p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
    221 </div>
     219        <div class="error">
     220                <p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
     221        </div>
    222222<?php endif; ?>
    223 <p><?php echo _n( 'You have specified this user for deletion:', 'You have specified these users for deletion:', count( $userids ) ); ?></p>
     223
     224<?php if ( 1 == count( $userids ) ) : ?>
     225        <p><?php _e( 'You have specified this user for deletion:' ); ?></p>
     226<?php else : ?>
     227        <p><?php _e( 'You have specified these users for deletion:' ); ?></p>
     228<?php endif; ?>
     229
    224230<ul>
    225231<?php
    226232        $go_delete = 0;
     
    236242        ?>
    237243        </ul>
    238244<?php if ( $go_delete ) : ?>
    239         <fieldset><p><legend><?php echo _n( 'What should be done with content owned by this user?', 'What should be done with content owned by these users?', $go_delete ); ?></legend></p>
     245        <?php if ( 1 == $go_delete ) : ?>
     246                <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
     247        <?php else : ?>
     248                <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
     249        <?php endif; ?>
    240250        <ul style="list-style:none;">
    241251                <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
    242252                <?php _e('Delete all content.'); ?></label></li>
     
    379389                case 'del':
    380390                case 'del_many':
    381391                        $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0;
    382                         $messages[] = '<div id="message" class="updated"><p>' . sprintf( _n( 'User deleted.', '%s users deleted.', $delete_count ), number_format_i18n( $delete_count ) ) . '</p></div>';
     392                        if ( 1 == $delete_count ) {
     393                                $message = __( 'User deleted.' );
     394                        } else {
     395                                $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
     396                        }
     397                        $messages[] = '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
    383398                        break;
    384399                case 'add':
    385400                        if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
  • src/wp-includes/class-wp-customize-manager.php

     
    13511351                $menus          = wp_get_nav_menus();
    13521352                $num_locations  = count( array_keys( $locations ) );
    13531353
     1354                if ( 1 == $num_locations ) {
     1355                        $description = __( 'Your theme supports one menu. Select which menu you would like to use.' );
     1356                } else {
     1357                        $description = sprintf( _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) );
     1358                }
     1359
    13541360                $this->add_section( 'nav', array(
    13551361                        'title'          => __( 'Navigation' ),
    13561362                        'theme_supports' => 'menus',
    13571363                        'priority'       => 100,
    1358                         'description'    => sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . "\n\n" . __('You can edit your menu content on the Menus screen in the Appearance section.'),
     1364                        'description'    => $description . "\n\n" . __( 'You can edit your menu content on the Menus screen in the Appearance section.' ),
    13591365                ) );
    13601366
    13611367                if ( $menus ) {
  • src/wp-includes/theme-compat/comments.php

     
    2323<!-- You can start editing here. -->
    2424
    2525<?php if ( have_comments() ) : ?>
    26         <h3 id="comments"><?php printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number() ),
    27                                                                         number_format_i18n( get_comments_number() ), '&#8220;' . get_the_title() . '&#8221;' ); ?></h3>
     26        <h3 id="comments">
     27                <?php
     28                        if ( 1 == get_comments_number() ) {
     29                                printf( 'One Response to %2$s',  '&#8220;' . get_the_title() . '&#8221;' );
     30                        } else {
     31                                printf( _n( '%1$s Response to %2$s', '%1$s Responses to %2$s', get_comments_number() ),
     32                                        number_format_i18n( get_comments_number() ),  '&#8220;' . get_the_title() . '&#8221;' );
     33                        }
     34                ?>
     35        </h3>
    2836
    2937        <div class="navigation">
    3038                <div class="alignleft"><?php previous_comments_link() ?></div>