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.
Built from https://develop.svn.wordpress.org/trunk@47156


git-svn-id: http://core.svn.wordpress.org/trunk@46956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-02-01 21:38:04 +00:00
parent 15a6accec4
commit deb1886078
20 changed files with 66 additions and 66 deletions

View File

@@ -134,11 +134,11 @@ function wp_authenticate_username_password( $user, $username, $password ) {
$error = new WP_Error();
if ( empty( $username ) ) {
$error->add( 'empty_username', __( '<strong>ERROR</strong>: The username field is empty.' ) );
$error->add( 'empty_username', __( '<strong>Error</strong>: The username field is empty.' ) );
}
if ( empty( $password ) ) {
$error->add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) );
$error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );
}
return $error;
@@ -172,7 +172,7 @@ function wp_authenticate_username_password( $user, $username, $password ) {
'incorrect_password',
sprintf(
/* translators: %s: User name. */
__( '<strong>ERROR</strong>: The password you entered for the username %s is incorrect.' ),
__( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ),
'<strong>' . $username . '</strong>'
) .
' <a href="' . wp_lostpassword_url() . '">' .
@@ -209,11 +209,11 @@ function wp_authenticate_email_password( $user, $email, $password ) {
if ( empty( $email ) ) {
// Uses 'empty_username' for back-compat with wp_signon().
$error->add( 'empty_username', __( '<strong>ERROR</strong>: The email field is empty.' ) );
$error->add( 'empty_username', __( '<strong>Error</strong>: The email field is empty.' ) );
}
if ( empty( $password ) ) {
$error->add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) );
$error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) );
}
return $error;
@@ -244,7 +244,7 @@ function wp_authenticate_email_password( $user, $email, $password ) {
'incorrect_password',
sprintf(
/* translators: %s: Email address. */
__( '<strong>ERROR</strong>: The password you entered for the email address %s is incorrect.' ),
__( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ),
'<strong>' . $email . '</strong>'
) .
' <a href="' . wp_lostpassword_url() . '">' .
@@ -319,7 +319,7 @@ function wp_authenticate_spam_check( $user ) {
$spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user );
if ( $spammed ) {
return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) );
return new WP_Error( 'spammer_account', __( '<strong>Error</strong>: Your account has been marked as a spammer.' ) );
}
}
return $user;
@@ -2265,7 +2265,7 @@ function get_password_reset_key( $user ) {
global $wp_hasher;
if ( ! ( $user instanceof WP_User ) ) {
return new WP_Error( 'invalidcombo', __( '<strong>ERROR</strong>: There is no account with that username or email address.' ) );
return new WP_Error( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) );
}
/**
@@ -2494,29 +2494,29 @@ function register_new_user( $user_login, $user_email ) {
// Check the username.
if ( $sanitized_user_login == '' ) {
$errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
$errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
} elseif ( ! validate_username( $user_login ) ) {
$errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
$errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
$sanitized_user_login = '';
} elseif ( username_exists( $sanitized_user_login ) ) {
$errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );
$errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
} else {
/** This filter is documented in wp-includes/user.php */
$illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() );
if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ), true ) ) {
$errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) );
$errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
}
}
// Check the email address.
if ( $user_email == '' ) {
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your email address.' ) );
$errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) );
} elseif ( ! is_email( $user_email ) ) {
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
$errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ) );
$user_email = '';
} elseif ( email_exists( $user_email ) ) {
$errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
$errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered, please choose another one.' ) );
}
/**
@@ -2561,7 +2561,7 @@ function register_new_user( $user_login, $user_email ) {
'registerfail',
sprintf(
/* translators: %s: Admin email address. */
__( '<strong>ERROR</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ),
__( '<strong>Error</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ),
get_option( 'admin_email' )
)
);
@@ -2796,7 +2796,7 @@ function send_confirmation_on_profile_email() {
if ( ! is_email( $_POST['email'] ) ) {
$errors->add(
'user_email',
__( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ),
__( '<strong>Error</strong>: The email address isn&#8217;t correct.' ),
array(
'form-field' => 'email',
)
@@ -2808,7 +2808,7 @@ function send_confirmation_on_profile_email() {
if ( email_exists( $_POST['email'] ) ) {
$errors->add(
'user_email',
__( '<strong>ERROR</strong>: The email address is already used.' ),
__( '<strong>Error</strong>: The email address is already used.' ),
array(
'form-field' => 'email',
)