-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing block translations #33326
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
@@ -30,7 +30,7 @@ type BlockSettingsProps = { | |||
}; | |||
|
|||
export const isAiAssistantSupportExtensionEnabled = | |||
window?.Jetpack_Editor_Initial_State.available_blocks?.[ AI_ASSISTANT_SUPPORT_NAME ]; | |||
window?.Jetpack_Editor_Initial_State?.available_blocks?.[ AI_ASSISTANT_SUPPORT_NAME ]; |
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.
Required to avoid exception being thrown.
@@ -7,8 +7,6 @@ import './editor.scss'; | |||
import './components/feedback/style.scss'; | |||
|
|||
registerJetpackBlockFromMetadata( metadata, { | |||
// The API version needs to be explicitly specified in this instance for styles to be loaded. | |||
apiVersion: metadata.apiVersion, |
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 required anymore.
'render_callback' => array( 'Automattic\\Jetpack\\Extensions\\Recipe\\Jetpack_Recipe_Block', 'render' ), | ||
) | ||
); | ||
add_action( |
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.
Wrap blocks registration in an init
action callback.
Blocks::jetpack_register_block( | ||
__DIR__, | ||
array( | ||
'render_callback' => array( 'Automattic\\Jetpack\\Extensions\\Recipe\\Jetpack_Recipe_Block', 'render' ), | ||
) | ||
); | ||
|
||
Blocks::jetpack_register_block( | ||
'jetpack/recipe-details', | ||
array( | ||
'parent' => array( 'jetpack/recipe' ), | ||
) | ||
); | ||
Blocks::jetpack_register_block( | ||
__DIR__, | ||
array( | ||
'render_callback' => array( 'Automattic\\Jetpack\\Extensions\\Recipe\\Jetpack_Recipe_Block', 'render' ), | ||
) | ||
); |
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.
Is it intended that you're making the same call twice here?
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.
No! Thank you.
4e2d7e9
to
a6f85cf
Compare
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.
LGTM
a6f85cf
to
b9b192c
Compare
This reverts commit b8d9424.
Fixes p1694788078746839-slack-CDLH4C1UZ
Proposed changes:
#32698, #32815, and #33073 introduced localization issues for simple sites: block titles and descriptions were displayed in English no matter the user's selected language. This PR fixes it.
The blocks involved are: Business Hours, AI Chat, Amazon, Blogroll, Google Docs Embed (Google Docs, Google Sheets, and Google Slides), Recipe, Create with Voice.
In more details:
register_block_type
to be called with the path toblock.json
or its parent directory.jetpack_register_block
is updated accordingly.registerBlockType
requires to be called with the metadata object.registerJetpackBlock
is updated to allow that.render
functions work correctly.init
action, to prevent an exception being thrown.Other information:
Jetpack product discussion
n/a
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Regression Testing
define( 'JETPACK_BLOCKS_VARIATION', 'beta' );
to yourwp-config.php
otherwise.Localization Testing
jetpack build plugins/jetpack
.Blocks info translated to French
![Screenshot 2023-09-19 at 9 47 38 AM](https://private-user-images.githubusercontent.com/1620183/269072083-b6cb23e4-b0de-4be5-ae59-ce82a9148aab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVk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WduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.CZZfNLVCgcvGwCgqodgv5Tff52WPn9L4W2uCLgxBLGg)
![Screenshot 2023-09-19 at 9 48 04 AM](https://private-user-images.githubusercontent.com/1620183/269072087-cbd3d4d2-22de-476e-90e5-8f672d93b6a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNzY4MzksIm5iZiI6MTcyMDI3NjUzOSwicGF0aCI6Ii8xNjIwMTgzLzI2OTA3MjA4Ny1jYmQzZDRkMi0yMmRlLTQ3NmUtOTBlNS04ZjY3MmQ5M2I2YTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDZUMTQzNTM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTVlODFmNjUwY2ZlOWVmZmRhZWViNjlhNGNiYzE0YjBlMzI2OTYzOGQyNzY4Mjg5YWNjZDY2MGY5OWY0YTRlMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.yZi-jRiACsgCfJU111DnmeuvmspcKctCsDglIi5incs)
![Screenshot 2023-09-19 at 9 48 15 AM](https://private-user-images.githubusercontent.com/1620183/269072090-d6d95720-2cbf-46a4-8a8d-ee140ec7b038.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYX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