README – Version 2.7 release
-
Version 2.7 of this plugin contains a workaround for the endless problems reported on this forum relating to custom translation files not loading. Specifically when this is due to early translation requests.
What problem does it supposedly fix?
When a plugin requests a translation before Loco Translate is running, the installed (GlotPress) translation will be used. Loco Translate cannot merge your custom translations when it’s not awake, and (since WordPress 6.7) explicit calls to
load_plugin_textdomain
will have no effect if the domain has been loaded already.What’s the workaround?
Loco Translate’s custom file loader now forcefully unloads all text domains that have been loaded before it was running. It does this indiscriminately, taking the view that any domains loaded at this point have been done so prematurely. This is drastic, and I don’t like it, but having battled with this issue for months, I don’t see any other solution.
This unloading will be accompanied with debug messages in your log files. The affected domains should also have triggered a notice from WordPress that they were loaded too early. I’m interested to hear under what circumstances this isn’t the case.
You can control this workaround with the loco_unload_early_textdomain filter. Ensure you define your filter before Loco Translate is running, and return false to disable completely.
But 2.6 worked, and 2.7 doesn’t!
If you have a new problem that wasn’t present in 2.6.14, then I want to hear about it. Before posting your problem, please try disabling the workaround mentioned above. There are no other major changes in this version, so most likely any new problem is a knock-on effect of domain unloading. I can’t imagine what side effects this could cause until I see them, so please post sufficient detail for me to reproduce your issue.
- The topic ‘README – Version 2.7 release’ is closed to new replies.