[wp-trac] [WordPress Trac] #39210: switch_to_locale() unloads all plugin and theme translations

WordPress Trac noreply at wordpress.org
Mon Oct 24 18:35:44 UTC 2022


#39210: switch_to_locale() unloads all plugin and theme translations
-------------------------------------------------+-------------------------
 Reporter:  gchtr                                |       Owner:  ocean90
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  I18N                                 |     Version:  4.7
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-unit-tests has-patch needs-dev-  |     Focuses:
  note commit                                    |
-------------------------------------------------+-------------------------

Comment (by ocean90):

 In [changeset:"54682" 54682]:
 {{{
 #!CommitTicketReference repository="" revision="54682"
 I18N: Change how `WP_Textdomain_Registry` stores the default languages
 path.

 `WP_Textdomain_Registry` was introduced in [53874] to store text domains
 and their language directory paths, addressing issues with just-in-time
 loading of textdomains when using locale switching and when
 using`load_*_textdomain()` functions.

 Said change has inadvertently caused a performance regression exactly when
 using`load_*_textdomain()`, which still often is the case, where the
 cached information was not further used or even overridden.

 This change addresses that issue by storing the default languages paths in
 a separate way, while at the same time making `WP_Textdomain_Registry`
 easier to maintain and adding new tests to catch future regressions.

 Props flixos90, spacedmonkey, ocean90, SergeyBiryukov, costdev.
 Merges [54669] to the 6.1 branch.
 See #39210.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39210#comment:87>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list