Skip to content

Fix: Update the static text and make them translatable in the Blocks example. #69859

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

Conversation

Debarghya-Banerjee
Copy link
Contributor

@Debarghya-Banerjee Debarghya-Banerjee commented Apr 8, 2025

What?

Fixes #69853

This PR updates example content in the blocks to make it translatable by replacing hardcoded text with translatable strings using the wp.i18n.__() function.

Why?

This PR is necessary because some example content in the blocks is currently hardcoded and not translatable, which prevents proper localization in different languages (e.g., Japanese). This update ensures that content can be properly localized for users in all locales.

How?

Replacing hardcoded text in block examples with wp.i18n.__() for translation.

Copy link

github-actions bot commented Apr 8, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Debarghya-Banerjee <debarghyabanerjee@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Debarghya-Banerjee Debarghya-Banerjee changed the title Fix: Make the Block examplestatic texts translatable Fix: Update the static text and make them translatable in the Blocks example. Apr 8, 2025
@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Package] Block library /packages/block-library l10n Localization and translations best practices labels Apr 9, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍

@t-hamano t-hamano added the props-bot Adding this label triggers the Props Bot workflow for a PR. label Apr 9, 2025
@github-actions github-actions bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label Apr 9, 2025
@t-hamano t-hamano merged commit 9fd1eaa into WordPress:trunk Apr 9, 2025
69 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.7 milestone Apr 9, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…example. (WordPress#69859)

* Make the static example texts translatable

* Update cover block example

Co-authored-by: Debarghya-Banerjee <debarghyabanerjee@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n Localization and translations best practices [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block Library: Make hard-coded block example content translatable
2 participants