#38482 closed defect (bug) (fixed)
Admin notices in the wrong language when switching language
Reported by: | afercia | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | I18N | Keywords: | has-screenshots has-patch needs-testing |
Focuses: | Cc: |
Description
Attachments (3)
Change History (17)
#2
in reply to:
↑ 1
@
8 years ago
Replying to swissspidy:
What's the user's language?
Initially English US. When I switch "Site Language" to German, the Language under my profile changes to "Deutsch".
#3
@
8 years ago
- Keywords needs-patch added
- Owner set to swissspidy
- Status changed from new to assigned
OK, in that case the user doesn't have a locale set yet. Under these circumstances I am able to reproduce this issue.
#5
@
8 years ago
Previously: ticket:29783:41, ticket:29783:42 and #29281
Looks like the logic is a bit off here https://core.trac.wordpress.org/browser/trunk/src/wp-admin/options.php?rev=38705&marks=220-229#L218
#6
@
8 years ago
- Keywords has-patch needs-testing added; needs-patch removed
Patch attached. Happy testing!
#7
follow-up:
↓ 10
@
8 years ago
Note that 38482.diff doesn't unload text domains as $language
is never empty. I used $GLOBALS['locale']
because later on in the file the settings errors are saved and the user gets redirected.
@ocean90 Perhaps you wanna chime in?
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#10
in reply to:
↑ 7
@
8 years ago
Replying to swissspidy:
Note that 38482.diff doesn't unload text domains as
$language
is never empty.
$language
is empty when the site language is set to en_US
. Changing the site language from de_DE
to en_US
shows the admin notice in German with 38482.diff.
#11
@
8 years ago
38482.2.diff should do it by comparing get_user_locale()
before and after.
What's the user's language?