Consolidate some strings. Props pavelevap, SergeyBiryukov. see #21728

git-svn-id: https://develop.svn.wordpress.org/trunk@22124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-10-05 19:04:34 +00:00
parent b0cae159ea
commit 8d5ca186c2
7 changed files with 16 additions and 16 deletions

View File

@ -224,12 +224,12 @@ function send_confirmation_on_profile_email() {
if ( $current_user->user_email != $_POST['email'] ) { if ( $current_user->user_email != $_POST['email'] ) {
if ( !is_email( $_POST['email'] ) ) { if ( !is_email( $_POST['email'] ) ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) ); $errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address isn&#8217;t correct." ), array( 'form-field' => 'email' ) );
return; return;
} }
if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) { if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address is already used." ), array( 'form-field' => 'email' ) ); $errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address is already used." ), array( 'form-field' => 'email' ) );
delete_option( $current_user->ID . '_new_email' ); delete_option( $current_user->ID . '_new_email' );
return; return;
} }

View File

@ -144,7 +144,7 @@ function edit_user( $user_id = 0 ) {
if ( empty( $user->user_email ) ) { if ( empty( $user->user_email ) ) {
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) ); $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );
} elseif ( !is_email( $user->user_email ) ) { } elseif ( !is_email( $user->user_email ) ) {
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The e-mail 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' ) );
} elseif ( ( $owner_id = email_exists($user->user_email) ) && ( !$update || ( $owner_id != $user->ID ) ) ) { } elseif ( ( $owner_id = email_exists($user->user_email) ) && ( !$update || ( $owner_id != $user->ID ) ) ) {
$errors->add( 'email_exists', __('<strong>ERROR</strong>: 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' ) );
} }

View File

@ -127,7 +127,7 @@ if ( ! empty( $messages ) ) {
<?php } else { <?php } else {
echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/> echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
<?php } <?php }
echo '<p>' . __( 'Only the characters a-z and 0-9 recommended.' ) . '</p>'; echo '<p>' . __( 'Only lowercase letters (a-z) and numbers are allowed.' ) . '</p>';
?> ?>
</td> </td>
</tr> </tr>

View File

@ -165,7 +165,7 @@ switch($step) {
foreach ( array( 'dbname', 'uname', 'pwd', 'dbhost', 'prefix' ) as $key ) foreach ( array( 'dbname', 'uname', 'pwd', 'dbhost', 'prefix' ) as $key )
$$key = trim( stripslashes( $_POST[ $key ] ) ); $$key = trim( stripslashes( $_POST[ $key ] ) );
$tryagain_link = '</p><p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">' . __( 'Try Again' ) . '</a>'; $tryagain_link = '</p><p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">' . __( 'Try again' ) . '</a>';
if ( empty( $prefix ) ) if ( empty( $prefix ) )
wp_die( __( '<strong>ERROR</strong>: "Table Prefix" must not be empty.' . $tryagain_link ) ); wp_die( __( '<strong>ERROR</strong>: "Table Prefix" must not be empty.' . $tryagain_link ) );

View File

@ -182,7 +182,7 @@ function add_user_to_blog( $blog_id, $user_id, $role ) {
if ( ! $user ) { if ( ! $user ) {
restore_current_blog(); restore_current_blog();
return new WP_Error('user_does_not_exist', __('That user does not exist.')); return new WP_Error( 'user_does_not_exist', __( 'The requested user does not exist.' ) );
} }
if ( !get_user_meta($user_id, 'primary_blog', true) ) { if ( !get_user_meta($user_id, 'primary_blog', true) ) {
@ -462,7 +462,7 @@ function wpmu_validate_user_signup($user_name, $user_email) {
$errors->add('user_name', __('Sorry, usernames must have letters too!')); $errors->add('user_name', __('Sorry, usernames must have letters too!'));
if ( !is_email( $user_email ) ) if ( !is_email( $user_email ) )
$errors->add('user_email', __( 'Please enter a correct email address.' ) ); $errors->add('user_email', __( 'Please enter a valid email address.' ) );
$limited_email_domains = get_site_option( 'limited_email_domains' ); $limited_email_domains = get_site_option( 'limited_email_domains' );
if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
@ -553,7 +553,7 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
$errors->add('blogname', __( 'Please enter a site name.' ) ); $errors->add('blogname', __( 'Please enter a site name.' ) );
if ( preg_match( '/[^a-z0-9]+/', $blogname ) ) if ( preg_match( '/[^a-z0-9]+/', $blogname ) )
$errors->add('blogname', __( 'Only lowercase letters and numbers allowed.' ) ); $errors->add('blogname', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );
if ( in_array( $blogname, $illegal_names ) == true ) if ( in_array( $blogname, $illegal_names ) == true )
$errors->add('blogname', __( 'That name is not allowed.' ) ); $errors->add('blogname', __( 'That name is not allowed.' ) );
@ -956,7 +956,7 @@ function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id
// Check if the domain has been used already. We should return an error message. // Check if the domain has been used already. We should return an error message.
if ( domain_exists($domain, $path, $site_id) ) if ( domain_exists($domain, $path, $site_id) )
return new WP_Error('blog_taken', __('Site already exists.')); return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) );
if ( !defined('WP_INSTALLING') ) if ( !defined('WP_INSTALLING') )
define( 'WP_INSTALLING', true ); define( 'WP_INSTALLING', true );
@ -1629,7 +1629,7 @@ function signup_nonce_check( $result ) {
return $result; return $result;
if ( wp_create_nonce('signup_form_' . $_POST[ 'signup_form_id' ]) != $_POST['_signup_form'] ) if ( wp_create_nonce('signup_form_' . $_POST[ 'signup_form_id' ]) != $_POST['_signup_form'] )
wp_die( __('Please try again!') ); wp_die( __( 'Please try again.' ) );
return $result; return $result;
} }

View File

@ -1305,7 +1305,7 @@ function wp_insert_user( $userdata ) {
return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') ); return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') );
if ( !$update && username_exists( $user_login ) ) if ( !$update && username_exists( $user_login ) )
return new WP_Error('existing_user_login', __('This username is already registered.') ); return new WP_Error( 'existing_user_login', __( 'Sorry, that username already exists!' ) );
if ( empty($user_nicename) ) if ( empty($user_nicename) )
$user_nicename = sanitize_title( $user_login ); $user_nicename = sanitize_title( $user_login );
@ -1320,7 +1320,7 @@ function wp_insert_user( $userdata ) {
$user_email = apply_filters('pre_user_email', $user_email); $user_email = apply_filters('pre_user_email', $user_email);
if ( !$update && ! defined( 'WP_IMPORTING' ) && email_exists($user_email) ) if ( !$update && ! defined( 'WP_IMPORTING' ) && email_exists($user_email) )
return new WP_Error('existing_user_email', __('This email address is already registered.') ); return new WP_Error( 'existing_user_email', __( 'Sorry, that email address is already used!' ) );
if ( empty($nickname) ) if ( empty($nickname) )
$nickname = $user_login; $nickname = $user_login;

View File

@ -315,7 +315,7 @@ function register_new_user( $user_login, $user_email ) {
$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 = ''; $sanitized_user_login = '';
} elseif ( username_exists( $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.' ) );
} }
// Check the e-mail address // Check the e-mail address