#52605 closed defect (bug) (fixed)
Reset password email sent in wrong language
Reported by: | Chouby | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | 5.7 |
Component: | Users | Keywords: | needs-unit-tests has-patch commit dev-reviewed |
Focuses: | Cc: |
Description
Testing the new WP 5.7 feature allowing admin to send a reset password link to users. https://make.wordpress.org/core/2021/02/22/send-reset-password-links-in-wordpress-5-7/ in 5.7-beta3-50398.
On a fresh WordPress site,
- Select Spanish as website language.
- Assign French as language for the administrator.
- Create a subscriber and select German for his/her language.
- As admin, click on "Send password reset" (not yet translated) for the German subscriber in the users list.
The email is sent in French (the language of the administrator).
I expect it to be sent in German.
If I assign the default site language to the German user, the email is still sent in French. I expect it to be sent in Spanish.
Attachments (2)
Change History (16)
#1
@
4 years ago
- Keywords needs-patch needs-unit-tests added
- Milestone changed from Awaiting Review to 5.7
#2
@
4 years ago
- Keywords has-patch added; needs-patch removed
Thanks @davidbaumwald, I tested your patch and it looks good to me.
Testing instructions I followed:
- Set up your website to English
- Changes its locale to French
- Set the website back to English
- Create a new user
- Set their locale to French
- Send a password reset link to the user: the email is in English. It should be in French (user's Locale)
- Apply the patch proposed by @davidbaumwald
- Send a password reset link to the user: the email is in French, merveilleux 🍷
#6
@
4 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
May I suggest 52605.2.diff as an improvement?
The reason for my proposal to move the switch_to_locale()
above the evaluation of the site name is to allow Polylang to translate the site name on the fly when retrieving the blogname
option.
#7
@
4 years ago
Thanks @Chouby, this makes sense to me and I am sure will prove useful for other plugins for multilingual sites.
#9
@
4 years ago
- Keywords dev-feedback fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for [50439] to be back-ported to the 5.7 branch after a second committer reviews.
#10
@
4 years ago
- Keywords commit dev-reviewed added; dev-feedback fixed-major removed
[50439] looks good to backport.
Moving to 5.7 to see if we can get a
switch_to_locale()
in there in time.