WordPress 6.7: MAJOR ISSUE loading custom translation files
-
Separately to a recent flurry of fixes to this plugin, there’s still a major issue in WordPress 6.7 affecting a lot of websites, and it’s not something my plugin can fix.
If you’re using Loco Translate for custom translation files and suddenly (after upgrading WordPress) those translations have reverted to English, then you’re almost certainly affected by this problem.
You can confirm you’re affected by enabling
WP_DEBUG
and checking for this early loading notice in your log files. If you see a relevant text domain in one of these messages, then it almost definitely explains why your translations have stopped showing.There will hopefully be a fix in WordPress 6.7.1 for this, but actually the root cause will still be there. Premature translation usage may have been the cause of smaller localisation issues you’ve noticed for some time.
It’s worth noting that the actual text domain provider may not be at fault. To use a popular example: if a WooCommerce add-on tries to access translations in the
woocommerce
text domain too early, it will break all future uses of that text domain and by no fault of the WooCommerce plugin itself.Just to reiterate, I’m referring here to custom translation files – meaning those not installed in the standard WordPress languages directory. If you have problems with installed translations, this notice is probably not relevant.
What should I do to get my site working?
Personally, I’d to revert to WordPress 6.6 (if that’s an option for you) and keep an eye out for a fix in 6.7.1.
You don’t need to roll back Loco Translate. In fact, upgrading to 2.6.14 is still recommended as it contains a fix for the long standing problem of loading custom translations without corresponding system translations installed.
Will Loco Translate be fixed?
I can’t fix anything in my plugin to get around this. In the first instance, the very nature of the early loading problem is that Loco Translate is not yet running. Secondarily, if the text domain is eventually loaded correctly, nothing actually happens. No WordPress hooks get fired, so my plugin can’t reload the text domain.
It would be possible for my plugin to forcefully unload all text domains when it starts up, (or at least any NOOP translations), but I’m not inclined to do this. I won’t go into the various reasons I think that’s a bad idea, but you can write your own code to do this if you want.
- You must be logged in to reply to this topic.