mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48115 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -134,11 +134,11 @@ function wp_authenticate_username_password( $user, $username, $password ) {
|
||||
$error = new WP_Error();
|
||||
|
||||
if ( empty( $username ) ) {
|
||||
$error->add( 'empty_username', __( 'The username field is empty.' ) );
|
||||
$error->add( 'empty_username', __( '<strong>Error</strong>: The username field is empty.' ) );
|
||||
}
|
||||
|
||||
if ( empty( $password ) ) {
|
||||
$error->add( 'empty_password', __( '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. */
|
||||
__( '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', __( 'The email field is empty.' ) );
|
||||
$error->add( 'empty_username', __( '<strong>Error</strong>: The email field is empty.' ) );
|
||||
}
|
||||
|
||||
if ( empty( $password ) ) {
|
||||
$error->add( 'empty_password', __( '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. */
|
||||
__( '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', __( '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;
|
||||
@@ -2283,7 +2283,7 @@ function get_password_reset_key( $user ) {
|
||||
global $wp_hasher;
|
||||
|
||||
if ( ! ( $user instanceof WP_User ) ) {
|
||||
return new WP_Error( 'invalidcombo', __( '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.' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2512,29 +2512,29 @@ function register_new_user( $user_login, $user_email ) {
|
||||
|
||||
// Check the username.
|
||||
if ( '' === $sanitized_user_login ) {
|
||||
$errors->add( 'empty_username', __( 'Please enter a username.' ) );
|
||||
$errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
|
||||
} elseif ( ! validate_username( $user_login ) ) {
|
||||
$errors->add( 'invalid_username', __( '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', __( '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', __( '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', __( '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', __( 'The email address isn’t correct.' ) );
|
||||
$errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn’t correct.' ) );
|
||||
$user_email = '';
|
||||
} elseif ( email_exists( $user_email ) ) {
|
||||
$errors->add( 'email_exists', __( '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.' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2579,7 +2579,7 @@ function register_new_user( $user_login, $user_email ) {
|
||||
'registerfail',
|
||||
sprintf(
|
||||
/* translators: %s: Admin email address. */
|
||||
__( 'Couldn’t register you… please contact the <a href="mailto:%s">site admin</a>!' ),
|
||||
__( '<strong>Error</strong>: Couldn’t register you… please contact the <a href="mailto:%s">site admin</a>!' ),
|
||||
get_option( 'admin_email' )
|
||||
)
|
||||
);
|
||||
@@ -2815,7 +2815,7 @@ function send_confirmation_on_profile_email() {
|
||||
if ( ! is_email( $_POST['email'] ) ) {
|
||||
$errors->add(
|
||||
'user_email',
|
||||
__( 'The email address isn’t correct.' ),
|
||||
__( '<strong>Error</strong>: The email address isn’t correct.' ),
|
||||
array(
|
||||
'form-field' => 'email',
|
||||
)
|
||||
@@ -2827,7 +2827,7 @@ function send_confirmation_on_profile_email() {
|
||||
if ( email_exists( $_POST['email'] ) ) {
|
||||
$errors->add(
|
||||
'user_email',
|
||||
__( 'The email address is already used.' ),
|
||||
__( '<strong>Error</strong>: The email address is already used.' ),
|
||||
array(
|
||||
'form-field' => 'email',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user