-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Read More: Add example preview #68288
Read More: Add example preview #68288
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Hi @t-hamano, |
@yogeshbhutkar Thanks for the PR! I noticed that the block example is not being translated. For example, in the Read more block in this PR, the default text in Japanese when the block is inserted is From my understanding, the If the examples contain content that may be localized, should the examples be defined in the JS code instead of in export const settings = {
icon,
edit,
example: {
attributes: {
content: _x( 'Read more', 'Example text for the Read More block' ),
},
},
}; This issue may occur in other blocks as well. |
That should work! Seems there are other instances of blocks with translated example content: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/button/index.js#L22-L22 |
Thanks, @t-hamano for reviewing the PR, and @ramonjd for providing the examples. I've implemented the suggested changes in the latest commit. However, I've found some blocks using example text that is not translated.
I'll update it as a comment inside the original issue so we can track this. |
Co-authored-by: Aki Hamano <[email protected]>
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.
Thanks for the approval @t-hamano. Here are the PRs that should incorporate translation-ready strings as per the comment mentioned above.
Can you please take a look at these PRs whenever you get a moment? |
Part of: #64707
What, Why & How?
This PR introduces an example preview for the
Read More
block.Testing Instructions
Global Inserter
Read More
block and notice the new preview.Screenshots