Make WordPress Core

Changeset 50139


Ignore:
Timestamp:
02/02/2021 12:15:22 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Users: Use consistent strings for error messages in wp-admin/users.php.

Use _n() for a string with plural forms.

Follow-up to [50129].

See #34281.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/users.php

    r50129 r50139  
    212212        check_admin_referer( 'bulk-users' );
    213213        if ( ! current_user_can( 'edit_users' ) ) {
    214             $errors = new WP_Error( 'edit_users', __( 'You can’t edit users.' ) );
     214            $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to edit users.' ) );
    215215        }
    216216        if ( empty( $_REQUEST['users'] ) ) {
     
    224224        foreach ( $userids as $id ) {
    225225            if ( ! current_user_can( 'edit_user', $id ) ) {
    226                 wp_die( __( 'You can’t edit that user.' ) );
     226                wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
    227227            }
    228228
     
    553553                    } else {
    554554                        /* translators: %s: Number of users. */
    555                         $message = sprintf( __( 'Password reset links sent to %s users.' ), $reset_count );
     555                        $message = _n( 'Password reset links sent to %s user.', 'Password reset links sent to %s users.', $reset_count );
    556556                    }
    557                     $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>';
     557                    $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $reset_count ) ) . '</p></div>';
    558558                    break;
    559559                case 'promote':
Note: See TracChangeset for help on using the changeset viewer.