Skip to content Skip to sidebar

Open

Reported for: WPML Multilingual & Multicurrency for WooCommerce 5.3.8

Topic Tags: Bug

Overview of the issue

When using WooCommerce blocks for the Cart and Checkout pages, certain strings like “Proceed to checkout” are not translated on the frontend for some languages. This issue is particularly visible in languages where WooCommerce native translations are incomplete.
It occurs because WooCommerce blocks rely on JavaScript translation files (.json files), which are not fully translatable through WPML String Translation.

Workaround

Before trying any of the workarounds, please be sure of having a full backup or your website.

Workaround 1

  1. Make sure you have at least one popular language installed on the site (e.g. Italian).
  2. Visit the cart page, it will register the script handler.
  3. Go to WPML > Theme and plugins localization page.
  4. Select the plugin “WooCommerce” and click on “Scan selected components for strings“.
  5. Then go to WPML > String Translation page and search the missing strings. For example, “Proceed to Checkout” in the domain woocommerce-wc-cart-block-frontend.
  6. Translate the string.

    Cart and Checkout strings should be translated now on the frontend.

Notes

If your website initially does not have any popular non-English language installed, you can add one and immediately hide it in the WPML > Languages page and repeat the previous procedure.

Workaround 2

To bypass this issue, use WooCommerce shortcodes instead of blocks for the Cart and Checkout pages.

  1. Edit the Cart and Checkout pages in WordPress.
  2. Replace the WooCommerce blocks with the following shortcodes:
    • Cart Page: woocommerce_cart
    • Checkout Page: woocommerce_checkout
  3. Save the changes.
  4. Go to WPML > String Translation page, and scan the .mo files for WooCommerce.
  5. Translate the strings as needed.

6 Responses to “WPML Multilingual & Multicurrency for WooCommerce - Cart Page Strings Not Translated When Using Blocks”

  1. Thanks that was the issue! I managed to replace them with shortcodes and then the translations worked just fine. Thank you so much for you prompt support on the matter!

    • Hi Morten,

      Thanks for reaching out! This feature requires some time to implement because it involves supporting the scanning and translation of strings from JavaScript files. The good news is that this isn’t just for WooCommerce blocks; it will benefit any plugin using strings in JS, improving overall translation capabilities.

      It will be implemented in later versions after the 4.7 release but we can’t provide an ETA at this moment. We appreciate your patience and will keep this erratum updated!

  2. Is there a solution yet? The shortcodes are breaking my design. In backend everything is translated well, but in frontend it’s not.

    • Hi there,

      Translating strings from JavaScript files is still in development. In the meantime, please open a ticket on the support forum, and we’ll be happy to help you implement a workaround.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>