#61518 closed enhancement (fixed)
Switch locale to admin locale when sending admin notifications
| Reported by: | benniledl | Owned by: | swissspidy |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.7 |
| Component: | I18N | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests has-dev-note |
| Cc: | Focuses: | administration |
Description
This patch takes the locale of the user associated with the admin_email and falls back to the site language if there is no user associated with this email address.
Change History (13)
This ticket was mentioned in PR #6919 on WordPress/wordpress-develop by @benniledl.
2 years ago
#1
- Keywords has-patch added
This ticket was mentioned in Slack in #core-i18n by benniledl. View the logs.
2 years ago
@swissspidy commented on PR #6919:
2 years ago
#6
@at-benni I just pushed some changes to your branch to also update wp_notify_postauthor() and wp_notify_moderator to do the same thing. They're a bit more complex as they loop through a bunch of emails, but they would also benefit from switching to the correct locale per recipient.
We might want to do a single restore_current_locale() instead of doing restore_previous_locale() in a loop, for performance reasons.
In addition to manual testing, this change would benefit from some unit tests. At least wp_new_user_notification has some test coverage already, so we can start there.
This ticket was mentioned in Slack in #core-test by benniledl. View the logs.
23 months ago
This ticket was mentioned in Slack in #core-i18n by benniledl. View the logs.
22 months ago
@swissspidy commented on PR #6919:
22 months ago
#11
Committed in https://core.trac.wordpress.org/changeset/59128
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This patch adds a new funciton called
get_admin_localeit takes the locale of the user associated with the admin_email and falls back to the site language if there is no user associated with this email address.Also the patch switches to the get_admin_locale function in the admin email notifications instead of get_locale
Trac ticket: https://core.trac.wordpress.org/ticket/61518