Known issue with Just-in-time text domain loading
-
Short version:
If you have translations in Loco Translate’s “Custom” directory, but NOT ALSO installed in the “System” location, Just-in-time text domain loading will NOT LOAD your custom translations.
—
Long version:
When WordPress loads a text domain via _load_textdomain_just_in_time, the “System” translations must exist, or the text domain loading process stops dead. This prevents Loco Translate (or any plugin) from loading alternative files.
There is no fix for this, other than to install the community translations in addition to your custom ones. This is actually the recommended way to customise translations, as shown in this guide.
The JIT loading problem won’t occur if a plugin (or theme) loads its text domain in advance (using load_plugin_texdomain, or load_theme_textdomain), However, in the case of popular plugins like woocommerce, dependent plugins sometimes request translations in the woocommerce text domain too early and JIT loading will occur before load_plugin_textdomain is called.
This post is for information only.
- You must be logged in to reply to this topic.