[wp-trac] [WordPress Trac] #44937: Add _doing_it_wrong to load_plugin_textdomain

WordPress Trac noreply at wordpress.org
Wed Oct 16 08:46:40 UTC 2024


#44937: Add _doing_it_wrong to load_plugin_textdomain
--------------------------------------+-------------------------
 Reporter:  garrett-eclipse           |       Owner:  swissspidy
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.7
Component:  I18N                      |     Version:  4.7
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note  |     Focuses:
--------------------------------------+-------------------------

Comment (by swissspidy):

 [59157] uncovered
 [https://github.com/woocommerce/woocommerce/issues/51843#issuecomment-2416087379
 an issue in WooCommerce], which caused early translation loading, then
 called `unload_textdomain()` followed by `load_plugin_textdomain()`.
 Because `load_plugin_textdomain()` doesn't actually load translations
 anymore, if you call it after `unload_textdomain()` it won't actually do
 anything. Fixing the early translation loading avoids this, because then
 there's nothing to unload yet.

 I couldn't find other plugins doing this, so probably not worth accounting
 for that in core, but worth noting here & keeping an eye out for.

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


More information about the wp-trac mailing list