woocommerce / woocommerce-blocks

(Deprecated) This plugin has been merged into woocommerce/woocommerce
https://wordpress.org/plugins/woo-gutenberg-products-block/
GNU General Public License v3.0
403 stars 218 forks source link

AJAX "X in cart" text not translated #3752

Closed aheckler closed 2 years ago

aheckler commented 3 years ago

Describe the bug

When using Blocks in a non-English language and AJAX add to cart enabled, the button text for a product in a block is not translated after adding it to the cart.

Video:

https://user-images.githubusercontent.com/5512652/106018459-88676780-608f-11eb-989f-bbae56a18cef.mov

You can see there that everything's in German until I add the beanie to the cart. The button text says 1 in cart.

Works correctly with the traditional WC shop page.

To reproduce

  1. WC test site + WC Blocks plugin + some sample products.
  2. Under WooCommerce > Settings > Products, enable AJAX add to cart.
  3. Create a page with an All Products block on it, publish it.
  4. Switch your site language to German, Spanish, anything non-English.
  5. Go to wp-admin/update-core.php and make sure you've downloaded/updated translations.
  6. On the All Products block page you made, try adding something to the cart.

Expected behavior

The message X in cart should be translated. It is not.

3688659-zen

budzanowski commented 3 years ago

@aheckler Are you using blocks available from WooCommerce or you have the WooCommerce blocks plugin installed?

aheckler commented 3 years ago

@budzanowski I tested it both ways, with WC Blocks enabled and with it disabled. Same thing either way.

github-actions[bot] commented 3 years ago

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.
github-actions[bot] commented 3 years ago

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.
github-actions[bot] commented 3 years ago

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.
nerrad commented 3 years ago

I think this should be fixed by the work done in #4392

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.
nielslange commented 2 years ago

@aheckler I looked up this problem. As @nerrad mentioned in https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/3752#issuecomment-901348051, it seems to have been fixed by #4392. While the German translation is still not visible, the Dutch translation is visible. The string in question is %d in cart.

Based on https://translate.wordpress.org/projects/wp-plugins/woo-gutenberg-products-block/stable/de/default/?filters%5Bterm%5D=%25d+in+cart&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc, the German string had been translated, but not approved yet. That's why the untranslated string appears currently.

On the other hand, https://translate.wordpress.org/projects/wp-plugins/woo-gutenberg-products-block/stable/nl/default/?filters%5Bterm%5D=%25d+in+cart&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc shows that the Dutch string had both been translated and approved. Therefore, the Dutch string already appears as expected.

There are various German strings waiting to be approved. I requested becoming a PTE for German and Dutch in https://make.wordpress.org/polyglots/2021/10/26/pte-request-for-woocommerce-blocks-2/. Once I have access, I can approve the strings resp. add missing strings. I'll keep you informed.

nielslange commented 2 years ago

@aheckler I received PTE rights for German and Dutch and added the missing string. The translation now appears as expected:

Screen Shot 2021-10-29 at 18 21 00