Support » Plugin: WooCommerce » “Shipping” string not translating

  • Resolved dponi00

    (@dponi00)


    Hello,

    Hope you’re doing fine. I have noticed that the string for “Shipping” has reverted back to English despite there being a Spanish (Mexico) string for it.

    It has happened on all my sites. One of them had a WooCommerce version which was quite old (3.3.3) and the string was ok. I updated WooCommerce today to 3.4.4 (first than any other plugin or making changes to the site) to test if it was the plugin that changed the string, and indeed it was shown in English.

    If you need a link to the other sites, let me know.

    I have followed the instructions on the sticky post “Updating Translations (after updates!)” and have checked for theme and plugin translations of the same string using Loco Translate.

    I would appreciate any help or ideas on how to fix it.

    Thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi dponi00,

    Maybe it’ll help you.

    Put it in your theme’s functions.php

    add_filter('gettext',  'translate_text');
    add_filter('ngettext',  'translate_text');
    
    function translate_text($translated) {
            
         $translated = str_ireplace('Shipping',  'What you want',  $translated);
            
         return $translated;
    }

    If it doesn’t help, than try to find it with Loco Translate
    https://hu.wordpress.org/plugins/loco-translate/

    Best,
    Chris

    Thread Starter dponi00

    (@dponi00)

    Hi Chris,

    thanks for your reply. Unfortunately it didn’t help.

    I already looked for the string with Loco Translate and made sure that it wasn’t being overwritten.

    I even created a blank install with just WooCommerce and WordPress in Spanish (Mexico) and it happened as well. I saw some websites in other languages which also had this issue but don’t remember any atm.

    Thanks again for any other ideas 🙂

    Delie

    There’s a few “shipping”s. The shipping package name defaults to Shipping and you can change it with a snippet:

    add_filter( 'woocommerce_shipping_package_name', 'tp_shipping_package_name' ); function tp_shipping_package_name( $name ) {
      return 'Envío';
    }

    Otherwise please post the url of the page where its showing.

    Thread Starter dponi00

    (@dponi00)

    Hi lorro,

    thanks! I checked and saw that the translation for “Shipping [ shipping package ]” was missing, I translated it and now everything is ok.

    Have a great day!

    Delie

    Thank you, this thread also fixed my issue!

    Use Loco Translate and find:
    translation for “Shipping [ shipping package ]”

    Successful, thanks!

    Stonez

    The Loco customised translation file needs to be saved in the custom location to be update-safe. That means it will not be updated by WooCommerce for any new strings for new or changed features, so you will need to find and add these strings yourself to your translation for evermore.

    The code fix or the Say What? plugin would avoid that burden.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘“Shipping” string not translating’ is closed to new replies.