This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Mini Cart Contents: Use block pattern to make the empty cart message translatable #6248
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rubikuserbot
requested review from
a team and
sunyatasattva
and removed request for
a team
April 13, 2022 13:56
Size Change: 0 B Total Size: 862 kB ℹ️ View Unchanged
|
dinhtungdu
added
status: needs review
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.
skip-changelog
PRs that you don't want to appear in the changelog.
labels
Apr 13, 2022
gigitux
approved these changes
Apr 13, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the new generated pot file there is the new string! Great job! LGTM 🚢
github-actions
bot
added
status: ready to merge
and removed
status: needs review
labels
Apr 13, 2022
Aljullu
approved these changes
Apr 13, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small non-blocking comments, but LGTM.
src/BlockTypes/MiniCart.php
Outdated
/** | ||
* Register block patter for Empty Cart Message to make it translatable. | ||
*/ | ||
public function register_block_pattern() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think renaming this method to register_empty_message_block_pattern
(or something similar) would make it clearer?
Co-authored-by: Albert Juhé Lluveras <[email protected]>
tarhi-saad
pushed a commit
that referenced
this pull request
Apr 13, 2022
…translatable (#6248) * try: use block pattern to make empty cart message translatable * Update src/BlockTypes/MiniCart.php Co-authored-by: Albert Juhé Lluveras <[email protected]> * rename function Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Luigi <[email protected]> (cherry picked from commit cfe73f1)
tarhi-saad
added a commit
that referenced
this pull request
Apr 14, 2022
* Empty commit for release pull request * Add Changelog to readme.txt * Update WC tested and required versions * Add testing notes * Register missing C&C inner blocks and update fallback template for older C& C versions (#6195) * Register missing C & C inner blocks and update fallback template for older C & C versions This will fix the issues with missing order summary inner blocks: Coupons (both in C & C blocks) and the Cart header. The issue was happening because, for example, for Cart the coupons were registred on the on frontend, but it just wasn't forced in the attributes. Because it also wasn't added to the PHP fallback layout, the render function didn't include it. For the Checkout block the coupons inner block wasn't registered at all. * Revert changes to Checkout.php, we don't need to test for inner blocks * Revert "Revert changes to Checkout.php, we don't need to test for inner blocks" This reverts commit fc39535. * Fix the returned template for older Checkout block iterations * Fix Cart and Checkout templates to accommodate the Summary order inner blocks * Hide coupon form div from inner blocks if coubons are not enabled * Fix checkout coupon tests in checkout They have been written for logged in user * Fix Order Summary Heading inner block's default text * Update comments with better wording * Revert "Hide coupon form div from inner blocks if coubons are not enabled" This reverts commit ab09021. (cherry picked from commit 40180ae) * Update the zip file link * Update testing instructions * Remove experimental build related PR from testing notes * Fix/order summary sidebar css (#6231) * Add box sizing to Totals item * Add some unit tests for Order summary blocks * Fix Proceed to checkout button size (cherry picked from commit 669aee7) * Update the WC required/tested versions * Mini Cart Contents: Use block pattern to make the empty cart message translatable (#6248) * try: use block pattern to make empty cart message translatable * Update src/BlockTypes/MiniCart.php Co-authored-by: Albert Juhé Lluveras <[email protected]> * rename function Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Luigi <[email protected]> (cherry picked from commit cfe73f1) * Update the release's ZIP file * Update testing notes In #6065, for Cart only Order Summary Heading & Coupon form can be removed, and for Checkout only the Coupon form. * Update the testing notes Remove #5870 testing notes because they can't be tested as a user * Update Testing notes Add screenshots to the #5967 testing notes * Remove #6166 testing instructions We reverted this PR * Revert (#6166) (#6253) Revert "Prevent Featured Product block from breaking when product is out of stock + hidden from catalog (#6166)" This reverts commit 3c0e0af (cherry picked from commit 908526e) * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Saad Tarhi <[email protected]> Co-authored-by: Raluca Stan <[email protected]> Co-authored-by: Luigi Teschio <[email protected]> Co-authored-by: Tung Du <[email protected]>
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.
skip-changelog
PRs that you don't want to appear in the changelog.
type: enhancement
The issue is a request for an enhancement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6213
This PR follows the Twenty Twenty-Two approach using a block pattern to make the empty cart message translatable. Previously, the empty cart message is hard-coded to the
mini-cart.html
template part and isn't translatable.Testing
Automated Tests
Manual Testing
How to test the changes in this Pull Request:
On Storefront:
On Twenty Twenty-Two:
Running
wp i18n make-pot ./ languages/woo-gutenberg-products-block.pot
in the root directory of the plugin, see new string for the empty cart message in the generated pot file:User Facing Testing
These are steps for user testing (where "user" is someone interacting with this change that is not editing any code).