• Resolved alexclairon

    (@alexclairon)


    Hi. The following happens to me, I want to translate the paragraph that appears in the checkout payment methods: “Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements”.
    I changed it with the poedit, but when I refresh the page the translation does not appear. Then I examined the file “woocommerce-es_ES.po” with the poedit, locotranslate and sublime-text and the translation appears correctly.
    Why doesn’t the phrase translate to me? Is there any cache in woocommerce?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I can’t tell why it didn’t work. The string has to be exactly right. The cache in WooCommerce, or transients, are for products. You can clear transients in Settings > System Status > Tools tab, but I don’t think these transients store strings.

    However, your edited translation file will be overwritten by updates, or if you save your updated translation file in the custom location, it will not be updated for you automatically in future.

    Instead you can use:
    https://en-gb.wordpress.org/plugins/say-what/

    When setting up a string in Say What?, the string to be translated is the exact string you get when US English is set. The domain is woocommerce, and the context is blank.

    Thread Starter alexclairon

    (@alexclairon)

    Hello, thanks for the answer.
    I try using the plugin “Say What?” but it seems that it doesn’t work for me (or I set it wrong). In the end I found the string in the plugin code, I didn’t find it at the beginning because it was in another language, and I changed it to my translation (in /templates/checkout/payment.php). I don’t know if this change will affect if in the future I want to add one or more languages to the web.
    I give the question as resolved, thank you!

    If you changed payment.php in the core plugin it will be overwritten by the next update.

    You can copy payment.php to:
    wp-content/themes/my-child-theme-name/woocommerce/checkout/payment.php
    and edit the copy. However, you will need to update the copy every so often when Woo next updates that template.

    The string to be translated is the exact string from payment.php. This will be the string you get if you temporarily change your site language to US English.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘A field is not translated’ is closed to new replies.