#38535 closed defect (bug) (fixed)
Don't init WP_Locale_Switcher in wp_load_translations_early()
| Reported by: | ocean90 | Owned by: | ocean90 |
|---|---|---|---|
| Priority: | high | Milestone: | 4.7 |
| Component: | I18N | Version: | 4.7 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
See ticket:29783:59.
WP_Locale_Switcher uses get_locale()/get_user_locale() to set the original locale. Both functions can return a fatal error if WordPress isn't fully initialized. [38976] tries to fix this but in a bad way. wp_load_translations_early() sets the locale based on various factors like WPLANG or $wp_local_package. [38976] assumes that it's always en_US.
I'm not aware of a use case where someone would need to switch locales while the site is crashing. I'm proposing to revert [38976] and [38977] and to remove WP_Locale_Switcher from wp_load_translations_early().
Related: #30049
Attachments (1)
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 39005: