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

WordPress Trac noreply at wordpress.org
Thu Oct 20 07:15:56 UTC 2022


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

Comment (by ocean90):

 Replying to [comment:66 flixos90]:
 > * When using the en_US locale, `load_textdomain()` is (unnecessarily)
 called a ton of times (107 times in WP 6.1-RC2 vs 3 times in WP 6.0.3).

 Assuming you have no other plugins active, could you explain what calls
 these are? And why there are unnecessary?


 > * The regression is only present on en_US sites. For sites that use a
 locale that typically has translation files present, performance remains
 basically as before.

 That's actually a good point since the changes here will significantly
 improve the translation handling
 [https://wordpress.org/about/stats/#locales for the majority of our user
 base]. ''If'' there's some tradeoff this should also be taken into
 consideration.


 I think for the moment we should identify what the problem actually is and
 if it's not something that can be fixed before the release and/or in a
 follow-up release.

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


More information about the wp-trac mailing list