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:
Andrea Fercia
2020-06-21 13:58:46 +00:00
parent e8176a19e2
commit 98d22d5d3d
25 changed files with 78 additions and 78 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ $parent_file = 'tools.php';
<h1><?php echo esc_html( $title ); ?></h1>
<?php if ( ! empty( $_GET['invalid'] ) ) : ?>
<div class="error">
<p>
<p><strong><?php _e( 'Error:' ); ?></strong>
<?php
/* translators: %s: Importer slug. */
printf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );
+3 -3
View File
@@ -1272,7 +1272,7 @@ function wp_ajax_replyto_comment( $action ) {
if ( empty( $post->post_status ) ) {
wp_die( 1 );
} elseif ( in_array( $post->post_status, array( 'draft', 'pending', 'trash' ), true ) ) {
wp_die( __( 'You can&#8217;t reply to a comment on a draft post.' ) );
wp_die( __( 'Error: You can&#8217;t reply to a comment on a draft post.' ) );
}
$user = wp_get_current_user();
@@ -1302,7 +1302,7 @@ function wp_ajax_replyto_comment( $action ) {
}
if ( '' === $comment_content ) {
wp_die( __( 'Please type your comment text.' ) );
wp_die( __( 'Error: Please type your comment text.' ) );
}
$comment_parent = 0;
@@ -1404,7 +1404,7 @@ function wp_ajax_edit_comment() {
}
if ( '' === $_POST['content'] ) {
wp_die( __( 'Please type your comment text.' ) );
wp_die( __( 'Error: Please type your comment text.' ) );
}
if ( isset( $_POST['status'] ) ) {
+1 -1
View File
@@ -2100,7 +2100,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
$connection_type = isset( $credentials['connection_type'] ) ? $credentials['connection_type'] : '';
if ( $error ) {
$error_string = __( 'There was an error connecting to the server. Please verify the settings are correct.' );
$error_string = __( '<strong>Error</strong>: Could not connect to the server. Please verify the settings are correct.' );
if ( is_wp_error( $error ) ) {
$error_string = esc_html( $error->get_error_message() );
}
+3 -3
View File
@@ -113,7 +113,7 @@ function network_step1( $errors = false ) {
global $is_apache;
if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
echo '<div class="error"><p>' . sprintf(
echo '<div class="error"><p><strong>' . __( 'Error:' ) . '</strong> ' . sprintf(
/* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */
__( 'The constant %s cannot be defined when creating a network.' ),
'<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'
@@ -139,7 +139,7 @@ function network_step1( $errors = false ) {
$hostname = get_clean_basedomain();
$has_ports = strstr( $hostname, ':' );
if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ), true ) ) ) {
echo '<div class="error"><p><strong>' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';
echo '<div class="error"><p><strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';
echo '<p>' . sprintf(
/* translators: %s: Port number. */
__( 'You cannot use port numbers such as %s.' ),
@@ -157,7 +157,7 @@ function network_step1( $errors = false ) {
$error_codes = array();
if ( is_wp_error( $errors ) ) {
echo '<div class="error"><p><strong>' . __( 'The network could not be created.' ) . '</strong></p>';
echo '<div class="error"><p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>';
foreach ( $errors->get_error_messages() as $error ) {
echo "<p>$error</p>";
}
+2 -2
View File
@@ -801,7 +801,7 @@ function install_plugin_information() {
if ( ! $compatible_php ) {
echo '<div class="notice notice-error notice-alt"><p>';
_e( 'This plugin <strong>requires a newer version of PHP</strong>.' );
_e( '<strong>Error:</strong> This plugin <strong>requires a newer version of PHP</strong>.' );
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
@@ -822,7 +822,7 @@ function install_plugin_information() {
echo '</p></div>';
} elseif ( ! $compatible_wp ) {
echo '<div class="notice notice-error notice-alt"><p>';
_e( 'This plugin <strong>requires a newer version of WordPress</strong>.' );
_e( '<strong>Error:</strong> This plugin <strong>requires a newer version of WordPress</strong>.' );
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
+3 -3
View File
@@ -1153,7 +1153,7 @@ function validate_plugin_requirements( $plugin ) {
'plugin_wp_php_incompatible',
sprintf(
/* translators: %s: Plugin name. */
_x( 'Current WordPress and PHP versions do not meet minimum requirements for %s.', 'plugin' ),
_x( '<strong>Error:</strong> Current WordPress and PHP versions do not meet minimum requirements for %s.', 'plugin' ),
$plugin_headers['Name']
)
);
@@ -1162,7 +1162,7 @@ function validate_plugin_requirements( $plugin ) {
'plugin_php_incompatible',
sprintf(
/* translators: %s: Plugin name. */
_x( 'Current PHP version does not meet minimum requirements for %s.', 'plugin' ),
_x( '<strong>Error:</strong> Current PHP version does not meet minimum requirements for %s.', 'plugin' ),
$plugin_headers['Name']
)
);
@@ -1171,7 +1171,7 @@ function validate_plugin_requirements( $plugin ) {
'plugin_wp_incompatible',
sprintf(
/* translators: %s: Plugin name. */
_x( 'Current WordPress version does not meet minimum requirements for %s.', 'plugin' ),
_x( '<strong>Error:</strong> Current WordPress version does not meet minimum requirements for %s.', 'plugin' ),
$plugin_headers['Name']
)
);
+11 -11
View File
@@ -143,12 +143,12 @@ function edit_user( $user_id = 0 ) {
/* checking that username has been typed */
if ( '' === $user->user_login ) {
$errors->add( 'user_login', __( 'Please enter a username.' ) );
$errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );
}
/* checking that nickname has been typed */
if ( $update && empty( $user->nickname ) ) {
$errors->add( 'nickname', __( 'Please enter a nickname.' ) );
$errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) );
}
/**
@@ -164,17 +164,17 @@ function edit_user( $user_id = 0 ) {
// Check for blank password when adding a user.
if ( ! $update && empty( $pass1 ) ) {
$errors->add( 'pass', __( 'Please enter a password.' ), array( 'form-field' => 'pass1' ) );
$errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );
}
// Check for "\" in password.
if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) {
$errors->add( 'pass', __( 'Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
$errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
}
// Checking the password has been typed twice the same.
if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
$errors->add( 'pass', __( 'Passwords don&#8217;t match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
$errors->add( 'pass', __( '<strong>Error</strong>: Passwords don&#8217;t match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
}
if ( ! empty( $pass1 ) ) {
@@ -182,29 +182,29 @@ function edit_user( $user_id = 0 ) {
}
if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) {
$errors->add( 'user_login', __( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
$errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
}
if ( ! $update && username_exists( $user->user_login ) ) {
$errors->add( 'user_login', __( 'This username is already registered. Please choose another one.' ) );
$errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
}
/** This filter is documented in wp-includes/user.php */
$illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_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.' ) );
}
/* checking email address */
if ( empty( $user->user_email ) ) {
$errors->add( 'empty_email', __( 'Please enter an email address.' ), array( 'form-field' => 'email' ) );
$errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );
} elseif ( ! is_email( $user->user_email ) ) {
$errors->add( 'invalid_email', __( 'The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
$errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
} else {
$owner_id = email_exists( $user->user_email );
if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
$errors->add( 'email_exists', __( 'This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
$errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
}
}
+1 -1
View File
@@ -221,7 +221,7 @@ if ( 'update' === $action ) { // We are saving settings sent from a settings pag
wp_die(
sprintf(
/* translators: %s: The options page name. */
__( 'Options page %s not found in the options whitelist.' ),
__( '<strong>Error</strong>: Options page %s not found in the options whitelist.' ),
'<code>' . esc_html( $option_page ) . '</code>'
)
);
+3 -3
View File
@@ -280,12 +280,12 @@ switch ( $step ) {
$tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try Again' ) . '</a>';
if ( empty( $prefix ) ) {
wp_die( __( '"Table Prefix" must not be empty.' ) . $tryagain_link );
wp_die( __( '<strong>Error</strong>: "Table Prefix" must not be empty.' ) . $tryagain_link );
}
// Validate $prefix: it can only contain letters, numbers and underscores.
if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {
wp_die( __( '"Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link );
wp_die( __( '<strong>Error</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link );
}
// Test the DB connection.
@@ -318,7 +318,7 @@ switch ( $step ) {
$wpdb->show_errors( $errors );
if ( ! $wpdb->last_error ) {
// MySQL was able to parse the prefix as a value, which we don't want. Bail.
wp_die( __( '"Table Prefix" is invalid.' ) );
wp_die( __( '<strong>Error</strong>: "Table Prefix" is invalid.' ) );
}
// Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password().
+1 -1
View File
@@ -300,7 +300,7 @@ if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {
$ct = wp_get_theme();
if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
echo '<div class="error"><p>' . $ct->errors()->get_error_message() . '</p></div>';
echo '<div class="error"><p>' . __( 'Error:' ) . ' ' . $ct->errors()->get_error_message() . '</p></div>';
}
/*
+1 -1
View File
@@ -274,7 +274,7 @@ switch ( $wp_list_table->current_action() ) {
<h1><?php _e( 'Delete Users' ); ?></h1>
<?php if ( isset( $_REQUEST['error'] ) ) : ?>
<div class="error">
<p><?php _e( 'Please select an option.' ); ?></p>
<p><strong><?php _e( 'Error:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
</div>
<?php endif; ?>