Make WordPress Core


Ignore:
Timestamp:
06/02/2022 03:03:39 PM (3 years ago)
Author:
audrasjb
Message:

Text Changes: Improve consistency of admin error notices.

This changeset replaces <strong>Error</strong>: with <strong>Error:</strong>, for better consistency.

Props transl8or, mihaidumitrascu, audrasjb.
Fixes #50785.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r53455 r53458  
    135135
    136136        if ( empty( $username ) ) {
    137             $error->add( 'empty_username', __( '<strong>Error</strong>: The username field is empty.' ) );
     137            $error->add( 'empty_username', __( '<strong>Error:</strong> The username field is empty.' ) );
    138138        }
    139139
    140140        if ( empty( $password ) ) {
    141             $error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );
     141            $error->add( 'empty_password', __( '<strong>Error:</strong> The password field is empty.' ) );
    142142        }
    143143
     
    152152            sprintf(
    153153                /* translators: %s: User name. */
    154                 __( '<strong>Error</strong>: The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead.' ),
     154                __( '<strong>Error:</strong> The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead.' ),
    155155                $username
    156156            )
     
    177177            sprintf(
    178178                /* translators: %s: User name. */
    179                 __( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ),
     179                __( '<strong>Error:</strong> The password you entered for the username %s is incorrect.' ),
    180180                '<strong>' . $username . '</strong>'
    181181            ) .
     
    214214        if ( empty( $email ) ) {
    215215            // Uses 'empty_username' for back-compat with wp_signon().
    216             $error->add( 'empty_username', __( '<strong>Error</strong>: The email field is empty.' ) );
     216            $error->add( 'empty_username', __( '<strong>Error:</strong> The email field is empty.' ) );
    217217        }
    218218
    219219        if ( empty( $password ) ) {
    220             $error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );
     220            $error->add( 'empty_password', __( '<strong>Error:</strong> The password field is empty.' ) );
    221221        }
    222222
     
    249249            sprintf(
    250250                /* translators: %s: Email address. */
    251                 __( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ),
     251                __( '<strong>Error:</strong> The password you entered for the email address %s is incorrect.' ),
    252252                '<strong>' . $email . '</strong>'
    253253            ) .
     
    352352            $error = new WP_Error(
    353353                'invalid_email',
    354                 __( '<strong>Error</strong>: Unknown email address. Check again or try your username.' )
     354                __( '<strong>Error:</strong> Unknown email address. Check again or try your username.' )
    355355            );
    356356        } else {
    357357            $error = new WP_Error(
    358358                'invalid_username',
    359                 __( '<strong>Error</strong>: Unknown username. Check again or try your email address.' )
     359                __( '<strong>Error:</strong> Unknown username. Check again or try your email address.' )
    360360            );
    361361        }
     
    504504
    505505        if ( $spammed ) {
    506             return new WP_Error( 'spammer_account', __( '<strong>Error</strong>: Your account has been marked as a spammer.' ) );
     506            return new WP_Error( 'spammer_account', __( '<strong>Error:</strong> Your account has been marked as a spammer.' ) );
    507507        }
    508508    }
     
    28312831
    28322832    if ( ! ( $user instanceof WP_User ) ) {
    2833         return new WP_Error( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );
     2833        return new WP_Error( 'invalidcombo', __( '<strong>Error:</strong> There is no account with that username or email address.' ) );
    28342834    }
    28352835
     
    30263026
    30273027    if ( empty( $user_login ) ) {
    3028         $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username or email address.' ) );
     3028        $errors->add( 'empty_username', __( '<strong>Error:</strong> Please enter a username or email address.' ) );
    30293029    } elseif ( strpos( $user_login, '@' ) ) {
    30303030        $user_data = get_user_by( 'email', trim( wp_unslash( $user_login ) ) );
    30313031        if ( empty( $user_data ) ) {
    3032             $errors->add( 'invalid_email', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );
     3032            $errors->add( 'invalid_email', __( '<strong>Error:</strong> There is no account with that username or email address.' ) );
    30333033        }
    30343034    } else {
     
    30843084
    30853085    if ( ! $user_data ) {
    3086         $errors->add( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );
     3086        $errors->add( 'invalidcombo', __( '<strong>Error:</strong> There is no account with that username or email address.' ) );
    30873087        return $errors;
    30883088    }
     
    32323232            sprintf(
    32333233                /* translators: %s: Documentation URL. */
    3234                 __( '<strong>Error</strong>: The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ),
     3234                __( '<strong>Error:</strong> The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ),
    32353235                esc_url( __( 'https://wordpress.org/support/article/resetting-your-password/' ) )
    32363236            )
     
    32993299    // Check the username.
    33003300    if ( '' === $sanitized_user_login ) {
    3301         $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
     3301        $errors->add( 'empty_username', __( '<strong>Error:</strong> Please enter a username.' ) );
    33023302    } elseif ( ! validate_username( $user_login ) ) {
    3303         $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     3303        $errors->add( 'invalid_username', __( '<strong>Error:</strong> This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    33043304        $sanitized_user_login = '';
    33053305    } elseif ( username_exists( $sanitized_user_login ) ) {
    3306         $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
     3306        $errors->add( 'username_exists', __( '<strong>Error:</strong> This username is already registered. Please choose another one.' ) );
    33073307
    33083308    } else {
     
    33103310        $illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() );
    33113311        if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ), true ) ) {
    3312             $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
     3312            $errors->add( 'invalid_username', __( '<strong>Error:</strong> Sorry, that username is not allowed.' ) );
    33133313        }
    33143314    }
     
    33163316    // Check the email address.
    33173317    if ( '' === $user_email ) {
    3318         $errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );
     3318        $errors->add( 'empty_email', __( '<strong>Error:</strong> Please type your email address.' ) );
    33193319    } elseif ( ! is_email( $user_email ) ) {
    3320         $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address is not correct.' ) );
     3320        $errors->add( 'invalid_email', __( '<strong>Error:</strong> The email address is not correct.' ) );
    33213321        $user_email = '';
    33223322    } elseif ( email_exists( $user_email ) ) {
     
    33733373            sprintf(
    33743374                /* translators: %s: Admin email address. */
    3375                 __( '<strong>Error</strong>: Could not register you&hellip; please contact the <a href="mailto:%s">site admin</a>!' ),
     3375                __( '<strong>Error:</strong> Could not register you&hellip; please contact the <a href="mailto:%s">site admin</a>!' ),
    33763376                get_option( 'admin_email' )
    33773377            )
     
    36163616            $errors->add(
    36173617                'user_email',
    3618                 __( '<strong>Error</strong>: The email address is not correct.' ),
     3618                __( '<strong>Error:</strong> The email address is not correct.' ),
    36193619                array(
    36203620                    'form-field' => 'email',
     
    36283628            $errors->add(
    36293629                'user_email',
    3630                 __( '<strong>Error</strong>: The email address is already used.' ),
     3630                __( '<strong>Error:</strong> The email address is already used.' ),
    36313631                array(
    36323632                    'form-field' => 'email',
Note: See TracChangeset for help on using the changeset viewer.