diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 5c6db55afb..0ea54f1a52 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -2759,6 +2759,11 @@ function retrieve_password( $user_login = null ) { $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } + // Localize password reset message content for user. + $locale = get_user_locale( $user_data ); + + $switched_locale = switch_to_locale( $locale ); + $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n"; /* translators: %s: Site name. */ $message .= sprintf( __( 'Site Name: %s' ), $site_name ) . "\r\n\r\n"; @@ -2807,6 +2812,10 @@ function retrieve_password( $user_login = null ) { */ $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data ); + if ( $switched_locale ) { + restore_previous_locale(); + } + if ( $message && ! wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) { $errors->add( 'retrieve_password_email_failure',