[wp-trac] [WordPress Trac] #62462: Reconsider _doing_it_wrong warning when loading translations early

WordPress Trac noreply at wordpress.org
Tue Dec 17 22:28:49 UTC 2024


#62462: Reconsider _doing_it_wrong warning when loading translations early
-------------------------------+---------------------
 Reporter:  TimothyBlynJacobs  |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  6.7.2
Component:  I18N               |     Version:  6.7
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+---------------------

Comment (by swissspidy):

 Again, the fact that a warning is emitted does not cause this behavior.
 Code execution isn't stopped, see https://github.com/WordPress/wordpress-
 develop/blob/c697356c29effcfa8115d852bc89385f7112c202/src/wp-
 includes/l10n.php#L1369-L1380.

 If anything, it would be a side effect of [59157], which is a related
 change that was made.

 The problem you encountered in LifterLMS 7.8.6 is that you loaded
 translations early and then **unloaded** them again in
 `llms_load_textdomain()`, which was called between the setup wizard steps
 at the top and the text at the bottom.

 Sure we can look into optimizing [59157] (perhaps best in a new ticket
 with a clean slate) to sort of restore previous behavior, but if a plugin
 is clearly doing it wrong, a warning is still warranted. And if a plugin
 is unloading its own translations, then core can't really do anything
 about it.

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


More information about the wp-trac mailing list