Make WordPress Core


Ignore:
Timestamp:
02/01/2020 09:36:44 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Accessibility: Text Changes: Use sentence case for the word Error in various error messages, instead of all caps.

Using all caps should be avoided for better readability and because screen readers may pronounce all-caps words as abbreviations.

Props afercia, ryokuhi, sabernhardt, garrett-eclipse.
See #47656, #43037, #42945.

File:
1 edited

Legend:

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

    r47122 r47156  
    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
     
    173173            sprintf(
    174174                /* translators: %s: User name. */
    175                 __( '<strong>ERROR</strong>: 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', __( '<strong>ERROR</strong>: 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', __( '<strong>ERROR</strong>: 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                 __( '<strong>ERROR</strong>: 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', __( '<strong>ERROR</strong>: 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    }
     
    22662266
    22672267    if ( ! ( $user instanceof WP_User ) ) {
    2268         return new WP_Error( 'invalidcombo', __( '<strong>ERROR</strong>: There is no account with that username or email address.' ) );
     2268        return new WP_Error( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );
    22692269    }
    22702270
     
    24952495    // Check the username.
    24962496    if ( $sanitized_user_login == '' ) {
    2497         $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
     2497        $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
    24982498    } elseif ( ! validate_username( $user_login ) ) {
    2499         $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     2499        $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    25002500        $sanitized_user_login = '';
    25012501    } elseif ( username_exists( $sanitized_user_login ) ) {
    2502         $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );
     2502        $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
    25032503
    25042504    } else {
     
    25062506        $illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() );
    25072507        if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ), true ) ) {
    2508             $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) );
     2508            $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
    25092509        }
    25102510    }
     
    25122512    // Check the email address.
    25132513    if ( $user_email == '' ) {
    2514         $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your email address.' ) );
     2514        $errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );
    25152515    } elseif ( ! is_email( $user_email ) ) {
    2516         $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
     2516        $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ) );
    25172517        $user_email = '';
    25182518    } elseif ( email_exists( $user_email ) ) {
    2519         $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
     2519        $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered, please choose another one.' ) );
    25202520    }
    25212521
     
    25622562            sprintf(
    25632563                /* translators: %s: Admin email address. */
    2564                 __( '<strong>ERROR</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ),
     2564                __( '<strong>Error</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ),
    25652565                get_option( 'admin_email' )
    25662566            )
     
    27972797            $errors->add(
    27982798                'user_email',
    2799                 __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ),
     2799                __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ),
    28002800                array(
    28012801                    'form-field' => 'email',
     
    28092809            $errors->add(
    28102810                'user_email',
    2811                 __( '<strong>ERROR</strong>: The email address is already used.' ),
     2811                __( '<strong>Error</strong>: The email address is already used.' ),
    28122812                array(
    28132813                    'form-field' => 'email',
Note: See TracChangeset for help on using the changeset viewer.