Skip to content

Commit

Permalink
Consolidate some strings. Props pavelevap, SergeyBiryukov. see #21728
Browse files Browse the repository at this point in the history
git-svn-id: http://core.svn.wordpress.org/trunk@22124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
Ryan Boren committed Oct 5, 2012
1 parent 3854fe2 commit 51920e1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions wp-admin/includes/ms.php
Expand Up @@ -224,12 +224,12 @@ function send_confirmation_on_profile_email() {

if ( $current_user->user_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;
}

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' );
return;
}
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/user.php
Expand Up @@ -144,7 +144,7 @@ function edit_user( $user_id = 0 ) {
if ( empty( $user->user_email ) ) {
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => '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 ) ) ) {
$errors->add( 'email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'), array( 'form-field' => 'email' ) );
}
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/network/site-new.php
Expand Up @@ -127,7 +127,7 @@
<?php } else {
echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
<?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>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/setup-config.php
Expand Up @@ -165,7 +165,7 @@ function setup_config_display_header() {
foreach ( array( 'dbname', 'uname', 'pwd', 'dbhost', 'prefix' ) as $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 ) )
wp_die( __( '<strong>ERROR</strong>: "Table Prefix" must not be empty.' . $tryagain_link ) );
Expand Down
16 changes: 8 additions & 8 deletions wp-includes/ms-functions.php
Expand Up @@ -182,7 +182,7 @@ function add_user_to_blog( $blog_id, $user_id, $role ) {

if ( ! $user ) {
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) ) {
Expand Down Expand Up @@ -462,7 +462,7 @@ function wpmu_validate_user_signup($user_name, $user_email) {
$errors->add('user_name', __('Sorry, usernames must have letters too!'));

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' );
if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
Expand All @@ -473,11 +473,11 @@ function wpmu_validate_user_signup($user_name, $user_email) {

// Check if the username has been used already.
if ( username_exists($user_name) )
$errors->add('user_name', __('Sorry, that username already exists!'));
$errors->add( 'user_name', __( 'Sorry, that username already exists!' ) );

// Check if the email address has been used already.
if ( email_exists($user_email) )
$errors->add('user_email', __('Sorry, that email address is already used!'));
$errors->add( 'user_email', __( 'Sorry, that email address is already used!' ) );

// Has someone already signed up for this username?
$signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name) );
Expand Down Expand Up @@ -553,7 +553,7 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
$errors->add('blogname', __( 'Please enter a site name.' ) );

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 )
$errors->add('blogname', __( 'That name is not allowed.' ) );
Expand Down Expand Up @@ -590,7 +590,7 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
$path = $base.$blogname.'/';
}
if ( domain_exists($mydomain, $path, $current_site->id) )
$errors->add('blogname', __('Sorry, that site already exists!'));
$errors->add( 'blogname', __( 'Sorry, that site already exists!' ) );

if ( username_exists( $blogname ) ) {
if ( is_object( $user ) == false || ( is_object($user) && ( $user->user_login != $blogname ) ) )
Expand Down Expand Up @@ -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.
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') )
define( 'WP_INSTALLING', true );
Expand Down Expand Up @@ -1629,7 +1629,7 @@ function signup_nonce_check( $result ) {
return $result;

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;
}
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/user.php
Expand Up @@ -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.') );

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) )
$user_nicename = sanitize_title( $user_login );
Expand All @@ -1320,7 +1320,7 @@ function wp_insert_user( $userdata ) {
$user_email = apply_filters('pre_user_email', $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) )
$nickname = $user_login;
Expand Down
2 changes: 1 addition & 1 deletion wp-login.php
Expand Up @@ -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.' ) );
$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
Expand Down

0 comments on commit 51920e1

Please sign in to comment.