close
Skip to content

i18n: Localise content attribute of the Read More block#810

Merged
mikachan merged 1 commit intotrunkfrom
fix/i18n-read-more-content-attribute
Feb 24, 2026
Merged

i18n: Localise content attribute of the Read More block#810
mikachan merged 1 commit intotrunkfrom
fix/i18n-read-more-content-attribute

Conversation

@bph
Copy link
Contributor

@bph bph commented Feb 24, 2026

Summary

Fixes #807.

The content attribute of the Read More block (<!-- wp:read-more {"content":"..."} /-->) was not being localised when exporting a block theme. This adds core/read-more to the get_localizable_block_attributes() map introduced in #788, alongside a corresponding test case.

Changes

  • includes/create-theme/theme-locale.php — add core/read-more => ['content'] to get_localizable_block_attributes()
  • tests/CbtThemeLocale/escapeBlockAttributes.php — add test case for the Read More block content attribute

Testing

Tested manually via WP Playground CLI with the local plugin mounted. Added a Read More block with a custom label, saved changes to theme, and confirmed the exported file contains <?php esc_attr_e('...', 'theme-slug');?> in place of the plain string.

Note: This is my first PR for this repo, and I leaned on Claude for research and testing.

@bph bph added the enhancement New feature or request label Feb 24, 2026
Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

Code changes look good to me, and it works as described. Thanks @bph!

@mikachan mikachan merged commit 8f1e0ea into trunk Feb 24, 2026
2 checks passed
@mikachan mikachan deleted the fix/i18n-read-more-content-attribute branch February 24, 2026 11:31
@bph
Copy link
Contributor Author

bph commented Feb 24, 2026

Thanks for the review @mikachan. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read more block: content attribute doesn't get internationalised

2 participants