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 block - fix translations handling #6153 #6158
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
419f2c8
Mini Cart block - fix translations handling #6153
gigitux b4a4519
Merge branch 'trunk' into fix/6153-mini-cart-i18n
gigitux a559c8f
Mini Cart block - fix translations handling (#6164)
dinhtungdu 4765958
loads translations for deps
gigitux cbadbfe
address code review. load translations close to associated scripts
dinhtungdu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
Looking closer, I notice that the
$wp_scripts->print_translations()
of enqueued scripts cause the JS errors; even we don'techo
them, they are still printed.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.
Not sure if related, but I remember being confused by something similar and it was because we hook into
pre_load_script_translations
to print the translations, which runs no matter if youecho
them or not:https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/2d0270cc23121f79a5d3f1759a7e7df43f1323a4/woocommerce-gutenberg-products-block.php#L239
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.
You're the lifesaver @Aljullu! Thanks so much for the suggestion!