Problem translating Woocommerce blocks
-
We have a Spanish language site that we recently redesigned using full site editing, including using woocommerce blocks to build the product pages. We noticed several strings that aren’t being translated into Spanish, for instance in the product page, the review count next to the product name (see screenshot) and in the store page, once you add a product the button text changed to “1 in cart” (see screenshot).
We figured out these were comming from Woocommerce because we turned off all other plugins and also switched to the WP default theme. So we did a search in the files themselves and found this:
const reviewsCount = sprintf( /* translators: %s is referring to the total of reviews for a product */ _n( '(%s customer review)', '(%s customer reviews)', reviews, 'woo-gutenberg-products-block' ), reviews );This comes from woocommerce/packages/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/block.tsx
So here is the issue: we have a translation in place for woocommerce text domain, but this is a different text domain ‘woo-gutenberg-products-block’ and we can’t figure out how to use it. We know there is a separate plugin that includes all the same blocks that uses that text domain, we’ve downloaded the language files and placed them both in wp-content/languages/plugins and wp-content/languages/woocommerce, but it’s doing nothing. We can’t access these strings from Locotranslate.
Any help would be greatly appreciated!
(If you go to the linked product page, you will see it says “ver valoraciones” instead of “# customer reviews”, it’s not translated, I just changed it with CSS)
- This topic was modified 2 years, 4 months ago by .
- This topic was modified 2 years, 4 months ago by .
The page I need help with: [log in to see the link]
The topic ‘Problem translating Woocommerce blocks’ is closed to new replies.