#61518 closed enhancement (fixed)
Switch locale to admin locale when sending admin notifications
Reported by: | benniledl | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch has-unit-tests has-dev-note |
Focuses: | administration | Cc: |
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.
7 months ago
#1
- Keywords has-patch added
This ticket was mentioned in Slack in #core-i18n by benniledl. View the logs.
6 months ago
#5
@
6 months ago
- Keywords needs-refresh needs-unit-tests added
- Milestone changed from Awaiting Review to 6.7
@swissspidy commented on PR #6919:
6 months 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.
5 months ago
This ticket was mentioned in Slack in #core-i18n by benniledl. View the logs.
4 months ago
@swissspidy commented on PR #6919:
4 months ago
#11
Committed in https://core.trac.wordpress.org/changeset/59128
This patch adds a new funciton called
get_admin_locale
it 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