• Plugin Author Tim W

    (@timwhitlock)


    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Just to correct a point I made about WooCommerce – Actually, WooCommerce calls unload_textdomain before loading its translations, which should clear any wrongly loaded files. However, the point stands for plugins and themes that don’t do this.

    • This reply was modified 3 days, 5 hours ago by Tim W.
    Plugin Author Tim W

    (@timwhitlock)

    Will it be fixed in WordPress?

    The upcoming fix in WP 6.7.1 looks like it addresses one problem case, where you see English instead of your translations. This is likely the most common case.

    However, despite my best efforts to convince them, this fix doesn’t remove “system” translations that got early loaded before Loco Translate was able to modify the translation paths. The team’s current position is that this case doesn’t exist.

    To clarify – if you see English instead of your custom translations, upgrading to 6.7.1 should fix your issue. If after upgrading you see the installed translations instead of your custom overrides, then this is probably why.

    Hello Tim, I saw that the 6.7.1 Beta is already available. Have you had a chance to test it yet?

    Plugin Author Tim W

    (@timwhitlock)

    If you want to follow up on your issue under 6.7.1 please post in your original topic, and provide details of what you’re asking me to test against.

    Hi.

    6.71 update solve the problem in one of my websites with other plugin (custom translations are working), but don’t solve the problem in 2 websites with woocommerce plugin (the custom translations are not showed)!!!

    Thx

    Plugin Author Tim W

    (@timwhitlock)

    @geekviseu If you want to discuss your specific case, please post details in a new topic. As I wrote above, 6.7.1 won’t fix all the problems that 6.7 introduced.

    Hi!

    As 6.7.1 did not fix my issue with German/English-translations in WooCommerce, I implemented a temporary fix. Maybe it can help others too.

    add_action('init', function() {
    unload_textdomain('woocommerce');
    load_textdomain('woocommerce', WP_LANG_DIR . '/plugins/woocommerce-de_DE.mo');
    }, 20);


    The code goes to the functions.php. It simply unloads and reloads the textdomain. Cheers!

    • This reply was modified 7 hours, 55 minutes ago by kaplamm.
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.