-
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
Section styles: support i18n for variations declared in theme.json
or theme style variations
#62552
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. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core GitHub repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/theme-i18n.json |
Flaky tests detected in 5ad228d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9501765632
|
@aaronrobertshaw I haven't found any docs for this, so I haven't update them. It'd be useful to incorporate examples (in the devnote of the feature, theme.json docs, etc.) that include the |
I'd like to hold on merging until I have the tests passing in the related PR for the i18n-command at wp-cli/i18n-command#405 |
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 👍
This tests as advertised. I also like that it helps make it clearer that the keys should be lowercase slugs even if we can't enforce that 100% due to BC.
I haven't found any docs for this, so I haven't update them
There's a dev note comment and draft post for it.
When updating the dev note and writing the docs, it will be worth mentioning that the title will only be used from the first source the style gets registered from. That is, if the variation is defined within the main theme.json and redefined in a theme style variation, the title set in the main theme.json is what will be used. It is not overridden.
Updating the handbook documentation is still in progress but bug fixes have taken priority during this 6.6 beta period. I'll hopefully return to it and the dev note next week.
The related work at wp-cli/i18n-command#405 is working fine when executing manually. There're some issues with the behat tests that shouldn't block this PR from landing (actually, after backporting this to core the tests there should be fixed). |
…or theme style variations (WordPress#62552) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
…or theme style variations (#62552) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
…or theme style variations (#62552) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
I just cherry-picked this PR to the wp/6.6-beta-3 branch to get it included in the next release: 0f53d7b |
…or theme style variations (#62552) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
What?
This PR adds support for internationalizing the block style variations labels defined from a
theme.json
or a theme style variation (e.g.:styles/ember.json
).Why?
We want to enable internationalization of the block style variations defined from a
theme.json
or a theme style variation.How?
Allow
title
to be provided when registering block style variations fromtheme.json
or theme style variations (e.g.:styles/ember.json
):title
as a valid propertytitle
as a translatable propertyTesting Instructions
In the
theme.json
of the theme, paste the following contents understyles.blocks.variations
:title
title
Note that the
title
was already permitted, so it didn't require any style registration/generation changes. This PR adds it as part of the schema used by editors for linting and makes it translatable.Related work
Enabling the
styles.blocks.variations.*.title
property to be translatable requires:title
string withinstyles.blocks.variations
wp-cli/i18n-command#405theme-i18n.json
in WordPress core as well (to be done as part of backporting this PR)