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

WordPress Trac noreply at wordpress.org
Thu Oct 20 22:32:17 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 flixos90):

 Replying to [comment:73 swissspidy]:
 > Your oroposed solution does not work as it breaks locale switching.
 Believe me, I have implemented this and am a component maintainer.

 Makes sense. Like I said, I'm not very familiar with the code here. Given
 that your PR looks more complex than what I would anticipate for this late
 in the release cycle though, I think it would be crucial to get someone
 else with l10n experience to review it (looking at you @ocean90).

 Realistically, this probably needs to be committed by Monday or reverted
 so that we can have it in the final RC (Tuesday).

 Replying to [comment:77 spacedmonkey]:
 > Forgive me, but I put together a very simple patch, that caches, if the
 file exists or not. See #3508. This seems to fix much of the problem, as I
 am seeing page speed improve.
 >
 > If this is not the solution, then I would love to understand why not.
 Because I don't see a reason not to cache is_readable, it seems it is not
 a value that is going to change in a page request.

 This doesn't address the underlying bug, since even with this caching,
 `load_textdomain()` still is called >100 times within one page load - that
 is the root problem here. I trust @swissspidy is working into the right
 direction (although I'm too unfamiliar with the underlying code to make
 for a good reviewer on this).

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


More information about the wp-trac mailing list