Make WordPress Core

Changeset 53458


Ignore:
Timestamp:
06/02/2022 03:03:39 PM (2 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.

Location:
trunk/src
Files:
10 edited

Legend:

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

    r53426 r53458  
    23032303
    23042304    if ( $error ) {
    2305         $error_string = __( '<strong>Error</strong>: Could not connect to the server. Please verify the settings are correct.' );
     2305        $error_string = __( '<strong>Error:</strong> Could not connect to the server. Please verify the settings are correct.' );
    23062306        if ( is_wp_error( $error ) ) {
    23072307            $error_string = esc_html( $error->get_error_message() );
  • trunk/src/wp-admin/includes/user.php

    r53455 r53458  
    144144    /* checking that username has been typed */
    145145    if ( '' === $user->user_login ) {
    146         $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );
     146        $errors->add( 'user_login', __( '<strong>Error:</strong> Please enter a username.' ) );
    147147    }
    148148
    149149    /* checking that nickname has been typed */
    150150    if ( $update && empty( $user->nickname ) ) {
    151         $errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) );
     151        $errors->add( 'nickname', __( '<strong>Error:</strong> Please enter a nickname.' ) );
    152152    }
    153153
     
    165165    // Check for blank password when adding a user.
    166166    if ( ! $update && empty( $pass1 ) ) {
    167         $errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );
     167        $errors->add( 'pass', __( '<strong>Error:</strong> Please enter a password.' ), array( 'form-field' => 'pass1' ) );
    168168    }
    169169
    170170    // Check for "\" in password.
    171171    if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) {
    172         $errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
     172        $errors->add( 'pass', __( '<strong>Error:</strong> Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
    173173    }
    174174
    175175    // Checking the password has been typed twice the same.
    176176    if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
    177         $errors->add( 'pass', __( '<strong>Error</strong>: Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
     177        $errors->add( 'pass', __( '<strong>Error:</strong> Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
    178178    }
    179179
     
    183183
    184184    if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) {
    185         $errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     185        $errors->add( 'user_login', __( '<strong>Error:</strong> This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    186186    }
    187187
    188188    if ( ! $update && username_exists( $user->user_login ) ) {
    189         $errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
     189        $errors->add( 'user_login', __( '<strong>Error:</strong> This username is already registered. Please choose another one.' ) );
    190190    }
    191191
     
    194194
    195195    if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) {
    196         $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
     196        $errors->add( 'invalid_username', __( '<strong>Error:</strong> Sorry, that username is not allowed.' ) );
    197197    }
    198198
    199199    /* checking email address */
    200200    if ( empty( $user->user_email ) ) {
    201         $errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );
     201        $errors->add( 'empty_email', __( '<strong>Error:</strong> Please enter an email address.' ), array( 'form-field' => 'email' ) );
    202202    } elseif ( ! is_email( $user->user_email ) ) {
    203         $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address is not correct.' ), array( 'form-field' => 'email' ) );
     203        $errors->add( 'invalid_email', __( '<strong>Error:</strong> The email address is not correct.' ), array( 'form-field' => 'email' ) );
    204204    } else {
    205205        $owner_id = email_exists( $user->user_email );
    206206        if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
    207             $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
     207            $errors->add( 'email_exists', __( '<strong>Error:</strong> This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
    208208        }
    209209    }
  • trunk/src/wp-admin/setup-config.php

    r53156 r53458  
    279279
    280280        if ( empty( $prefix ) ) {
    281             wp_die( __( '<strong>Error</strong>: "Table Prefix" must not be empty.' ) . $tryagain_link );
     281            wp_die( __( '<strong>Error:</strong> "Table Prefix" must not be empty.' ) . $tryagain_link );
    282282        }
    283283
    284284        // Validate $prefix: it can only contain letters, numbers and underscores.
    285285        if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {
    286             wp_die( __( '<strong>Error</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link );
     286            wp_die( __( '<strong>Error:</strong> "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link );
    287287        }
    288288
     
    317317        if ( ! $wpdb->last_error ) {
    318318            // MySQL was able to parse the prefix as a value, which we don't want. Bail.
    319             wp_die( __( '<strong>Error</strong>: "Table Prefix" is invalid.' ) );
     319            wp_die( __( '<strong>Error:</strong> "Table Prefix" is invalid.' ) );
    320320        }
    321321
  • trunk/src/wp-includes/comment.php

    r53299 r53458  
    12711271
    12721272    if ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) {
    1273         return new WP_Error( 'comment_author_column_length', __( '<strong>Error</strong>: Your name is too long.' ), 200 );
     1273        return new WP_Error( 'comment_author_column_length', __( '<strong>Error:</strong> Your name is too long.' ), 200 );
    12741274    }
    12751275
    12761276    if ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) {
    1277         return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error</strong>: Your email address is too long.' ), 200 );
     1277        return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error:</strong> Your email address is too long.' ), 200 );
    12781278    }
    12791279
    12801280    if ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) {
    1281         return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error</strong>: Your URL is too long.' ), 200 );
     1281        return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error:</strong> Your URL is too long.' ), 200 );
    12821282    }
    12831283
    12841284    if ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) {
    1285         return new WP_Error( 'comment_content_column_length', __( '<strong>Error</strong>: Your comment is too long.' ), 200 );
     1285        return new WP_Error( 'comment_content_column_length', __( '<strong>Error:</strong> Your comment is too long.' ), 200 );
    12861286    }
    12871287
     
    35303530    if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
    35313531        if ( '' == $comment_author_email || '' == $comment_author ) {
    3532             return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields.' ), 200 );
     3532            return new WP_Error( 'require_name_email', __( '<strong>Error:</strong> Please fill the required fields.' ), 200 );
    35333533        } elseif ( ! is_email( $comment_author_email ) ) {
    3534             return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );
     3534            return new WP_Error( 'require_valid_email', __( '<strong>Error:</strong> Please enter a valid email address.' ), 200 );
    35353535        }
    35363536    }
     
    35573557    $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
    35583558    if ( '' === $comment_content && ! $allow_empty_comment ) {
    3559         return new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type your comment text.' ), 200 );
     3559        return new WP_Error( 'require_valid_comment', __( '<strong>Error:</strong> Please type your comment text.' ), 200 );
    35603560    }
    35613561
     
    35713571
    35723572    if ( ! $comment_id ) {
    3573         return new WP_Error( 'comment_save_error', __( '<strong>Error</strong>: The comment could not be saved. Please try again later.' ), 500 );
     3573        return new WP_Error( 'comment_save_error', __( '<strong>Error:</strong> The comment could not be saved. Please try again later.' ), 500 );
    35743574    }
    35753575
  • trunk/src/wp-includes/load.php

    r53426 r53458  
    625625            sprintf(
    626626                /* translators: 1: $table_prefix, 2: wp-config.php */
    627                 __( '<strong>Error</strong>: %1$s in %2$s can only contain numbers, letters, and underscores.' ),
     627                __( '<strong>Error:</strong> %1$s in %2$s can only contain numbers, letters, and underscores.' ),
    628628                '<code>$table_prefix</code>',
    629629                '<code>wp-config.php</code>'
  • trunk/src/wp-includes/ms-deprecated.php

    r53455 r53458  
    402402    // Check if the domain has been used already. We should return an error message.
    403403    if ( domain_exists($domain, $path, $site_id) )
    404         return __( '<strong>Error</strong>: Site URL you&#8217;ve entered is already taken.' );
     404        return __( '<strong>Error:</strong> Site URL you&#8217;ve entered is already taken.' );
    405405
    406406    /*
     
    411411
    412412    if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
    413         return __( '<strong>Error</strong>: There was a problem creating site entry.' );
     413        return __( '<strong>Error:</strong> There was a problem creating site entry.' );
    414414
    415415    switch_to_blog($blog_id);
  • trunk/src/wp-includes/pluggable.php

    r53301 r53458  
    623623            // TODO: What should the error message be? (Or would these even happen?)
    624624            // Only needed if all authentication handlers fail to return anything.
    625             $user = new WP_Error( 'authentication_failed', __( '<strong>Error</strong>: Invalid username, email address or incorrect password.' ) );
     625            $user = new WP_Error( 'authentication_failed', __( '<strong>Error:</strong> Invalid username, email address or incorrect password.' ) );
    626626        }
    627627
  • 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',
  • trunk/src/wp-includes/wp-db.php

    r53299 r53458  
    36983698        if ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) {
    36993699            /* translators: 1: WordPress version number, 2: Minimum required MySQL version number. */
    3700             return new WP_Error( 'database_version', sprintf( __( '<strong>Error</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) );
     3700            return new WP_Error( 'database_version', sprintf( __( '<strong>Error:</strong> WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) );
    37013701        }
    37023702    }
  • trunk/src/wp-login.php

    r53455 r53458  
    791791        if ( isset( $_GET['error'] ) ) {
    792792            if ( 'invalidkey' === $_GET['error'] ) {
    793                 $errors->add( 'invalidkey', __( '<strong>Error</strong>: Your password reset link appears to be invalid. Please request a new link below.' ) );
     793                $errors->add( 'invalidkey', __( '<strong>Error:</strong> Your password reset link appears to be invalid. Please request a new link below.' ) );
    794794            } elseif ( 'expiredkey' === $_GET['error'] ) {
    795                 $errors->add( 'expiredkey', __( '<strong>Error</strong>: Your password reset link has expired. Please request a new link below.' ) );
     795                $errors->add( 'expiredkey', __( '<strong>Error:</strong> Your password reset link has expired. Please request a new link below.' ) );
    796796            }
    797797        }
     
    919919        // Check if password fields do not match.
    920920        if ( ! empty( $_POST['pass1'] ) && trim( $_POST['pass2'] ) !== $_POST['pass1'] ) {
    921             $errors->add( 'password_reset_mismatch', __( '<strong>Error</strong>: The passwords do not match.' ) );
     921            $errors->add( 'password_reset_mismatch', __( '<strong>Error:</strong> The passwords do not match.' ) );
    922922        }
    923923
     
    12271227                    sprintf(
    12281228                        /* translators: 1: Browser cookie documentation URL, 2: Support forums URL. */
    1229                         __( '<strong>Error</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
     1229                        __( '<strong>Error:</strong> Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
    12301230                        __( 'https://wordpress.org/support/article/cookies/' ),
    12311231                        __( 'https://wordpress.org/support/forums/' )
     
    12381238                    sprintf(
    12391239                        /* translators: %s: Browser cookie documentation URL. */
    1240                         __( '<strong>Error</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
     1240                        __( '<strong>Error:</strong> Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
    12411241                        __( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' )
    12421242                    )
     
    13421342                $errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' );
    13431343            } elseif ( isset( $_GET['registration'] ) && 'disabled' === $_GET['registration'] ) {
    1344                 $errors->add( 'registerdisabled', __( '<strong>Error</strong>: User registration is currently not allowed.' ) );
     1344                $errors->add( 'registerdisabled', __( '<strong>Error:</strong> User registration is currently not allowed.' ) );
    13451345            } elseif ( strpos( $redirect_to, 'about.php?updated' ) ) {
    13461346                $errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what&#8217;s new.' ), 'message' );
Note: See TracChangeset for help on using the changeset viewer.