litespeedtech / lscache_wp

LiteSpeed Cache for WordPress
http://wordpress.org/plugins/litespeed-cache/
GNU General Public License v3.0
210 stars 110 forks source link

Rely on just-in-time translation loading #738

Open swissspidy opened 3 weeks ago

swissspidy commented 3 weeks ago

The plugin was loading translations too early on plugins_loaded. Plugins should wait until init to ensure the current user has been set up, so that the current user's locale can be respected.

That said, why manually load translations when WordPress can do it for you :-)

Removes the manual load_plugin_textdomain() call to rely on WordPress to load translations at the right time, which was added in WordPress 4.6.

szepeviktor commented 3 weeks ago

was added in WordPress 4.6

https://github.com/litespeedtech/lscache_wp/blob/3ec3132c766eb495dbfe519ba9c76695372e8b9e/readme.txt#L4

swissspidy commented 3 weeks ago

Yep 👍

I noticed they changed this since I opened my previous PR (#657) which I accidentally deleted

szepeviktor commented 3 weeks ago

https://github.com/litespeedtech/lscache_wp/blob/3ec3132c766eb495dbfe519ba9c76695372e8b9e/litespeed-cache.php#L183

hi-hai commented 3 weeks ago

Thanks. Will review and consider to use this as we escalated the WP min ver from v4.0 to v4.9.