Make WordPress Core


Ignore:
Timestamp:
06/21/2020 01:58:46 PM (5 years ago)
Author:
afercia
Message:

I18N: Restore the "Error:" prefix for error messages.

Partially reverts [48059] as there's no full consensus on the removal of the text prefix. Further actions should be taken to improve consistency and accessibility of the admin notices. Keeps some improvements to the translatable strings from [48059].

Fixes #47656.

File:
1 edited

Legend:

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

    r48107 r48115  
    135135
    136136        if ( empty( $username ) ) {
    137             $error->add( 'empty_username', __( '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', __( 'The password field is empty.' ) );
     141            $error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );
    142142        }
    143143
     
    173173            sprintf(
    174174                /* translators: %s: User name. */
    175                 __( 'The password you entered for the username %s is incorrect.' ),
     175                __( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ),
    176176                '<strong>' . $username . '</strong>'
    177177            ) .
     
    210210        if ( empty( $email ) ) {
    211211            // Uses 'empty_username' for back-compat with wp_signon().
    212             $error->add( 'empty_username', __( 'The email field is empty.' ) );
     212            $error->add( 'empty_username', __( '<strong>Error</strong>: The email field is empty.' ) );
    213213        }
    214214
    215215        if ( empty( $password ) ) {
    216             $error->add( 'empty_password', __( 'The password field is empty.' ) );
     216            $error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );
    217217        }
    218218
     
    245245            sprintf(
    246246                /* translators: %s: Email address. */
    247                 __( 'The password you entered for the email address %s is incorrect.' ),
     247                __( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ),
    248248                '<strong>' . $email . '</strong>'
    249249            ) .
     
    320320
    321321        if ( $spammed ) {
    322             return new WP_Error( 'spammer_account', __( 'Your account has been marked as a spammer.' ) );
     322            return new WP_Error( 'spammer_account', __( '<strong>Error</strong>: Your account has been marked as a spammer.' ) );
    323323        }
    324324    }
     
    22842284
    22852285    if ( ! ( $user instanceof WP_User ) ) {
    2286         return new WP_Error( 'invalidcombo', __( 'There is no account with that username or email address.' ) );
     2286        return new WP_Error( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );
    22872287    }
    22882288
     
    25132513    // Check the username.
    25142514    if ( '' === $sanitized_user_login ) {
    2515         $errors->add( 'empty_username', __( 'Please enter a username.' ) );
     2515        $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
    25162516    } elseif ( ! validate_username( $user_login ) ) {
    2517         $errors->add( 'invalid_username', __( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     2517        $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    25182518        $sanitized_user_login = '';
    25192519    } elseif ( username_exists( $sanitized_user_login ) ) {
    2520         $errors->add( 'username_exists', __( 'This username is already registered. Please choose another one.' ) );
     2520        $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
    25212521
    25222522    } else {
     
    25242524        $illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() );
    25252525        if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ), true ) ) {
    2526             $errors->add( 'invalid_username', __( 'Sorry, that username is not allowed.' ) );
     2526            $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
    25272527        }
    25282528    }
     
    25302530    // Check the email address.
    25312531    if ( '' === $user_email ) {
    2532         $errors->add( 'empty_email', __( 'Please type your email address.' ) );
     2532        $errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );
    25332533    } elseif ( ! is_email( $user_email ) ) {
    2534         $errors->add( 'invalid_email', __( 'The email address isn&#8217;t correct.' ) );
     2534        $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ) );
    25352535        $user_email = '';
    25362536    } elseif ( email_exists( $user_email ) ) {
    2537         $errors->add( 'email_exists', __( 'This email is already registered. Please choose another one.' ) );
     2537        $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ) );
    25382538    }
    25392539
     
    25802580            sprintf(
    25812581                /* translators: %s: Admin email address. */
    2582                 __( 'Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">site admin</a>!' ),
     2582                __( '<strong>Error</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">site admin</a>!' ),
    25832583                get_option( 'admin_email' )
    25842584            )
     
    28162816            $errors->add(
    28172817                'user_email',
    2818                 __( 'The email address isn&#8217;t correct.' ),
     2818                __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ),
    28192819                array(
    28202820                    'form-field' => 'email',
     
    28282828            $errors->add(
    28292829                'user_email',
    2830                 __( 'The email address is already used.' ),
     2830                __( '<strong>Error</strong>: The email address is already used.' ),
    28312831                array(
    28322832                    'form-field' => 'email',
Note: See TracChangeset for help on using the changeset viewer.