Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Mini Cart: "Your cart is currently empty!" isn't translatable. #6213

Closed
dinhtungdu opened this issue Apr 8, 2022 · 2 comments · Fixed by #6248
Closed

Mini Cart: "Your cart is currently empty!" isn't translatable. #6213

dinhtungdu opened this issue Apr 8, 2022 · 2 comments · Fixed by #6248
Labels
block: mini-cart Issues related to the Mini-Cart block. focus: i18n The issue/PR is related to internationalization. type: enhancement The issue is a request for an enhancement.

Comments

@dinhtungdu
Copy link
Member

dinhtungdu commented Apr 8, 2022

Is your feature request related to a problem? Please describe.

The string comes from mini-cart.html so it's translatable.

Describe the solution you'd like

We can consider the Twenty Twenty-Two approach using block patterns to support translation.

<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:0px;padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:template-part {"slug":"header","tagName":"header","align":"wide"} /-->

<!-- wp:pattern {"slug":"twentytwentytwo/hidden-heading-and-bird"} /-->

</div>
@dinhtungdu dinhtungdu added type: enhancement The issue is a request for an enhancement. focus: i18n The issue/PR is related to internationalization. block: mini-cart Issues related to the Mini-Cart block. labels Apr 8, 2022
@nielslange
Copy link
Member

We can consider the Twenty Twenty-Two approach using block patterns to support translation.

This approach will not work when using a non-FSE-theme such as Storefront, will it? Besides that, I'm also concerned if some strings need to be translated via WP Admin » Design » Editor, while other strings need to be translated via https://translate.wordpress.org/projects/wp-plugins/woo-gutenberg-products-block/.

Personally, for the Your cart is currently empty! message, I'd rather follow the same approach as for the Start shopping button, as implemented in #5614. That way, all translations are stored centralized and will be accessible to all translation contributors.

@dinhtungdu
Copy link
Member Author

This approach will not work when using a non-FSE-theme such as Storefront, will it?

@nielslange It will. The approach doesn't require the Site Editor because the block pattern belongs to the Blocks Editor. I tested and it works on Storefront.

Besides that, I'm also concerned if some strings need to be translated via WP Admin » Design » Editor, while other strings need to be translated via translate.wordpress.org/projects/wp-plugins/woo-gutenberg-products-block.

Can you clarify this? As far as I know, strings in PHP and JS all can be translated via https://translate.wordpress.org/projects/wp-plugins/woo-gutenberg-products-block/.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. focus: i18n The issue/PR is related to internationalization. type: enhancement The issue is a request for an enhancement.
Projects
None yet
2 participants