-
Notifications
You must be signed in to change notification settings - Fork 59
theme.json: find title string within styles.blocks.variations
#405
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
theme.json: find title string within styles.blocks.variations
#405
Conversation
|
It's not ready yet, hence the draft status. Will finalize it in the following days. |
|
Why is this kind of stuff happening so late in the cycle? 🤔 FWIW we now have an automated GitHub Actions workflow updating the schema in this repo. It's based on the schema in WordPress core trunk. |
It‘s because this change is not in core trunk yet. |
How the behat tests find the schema? Don't they use the Am I running the right command? composer behat -- features/makepot.feature |
|
Yes that's the command. Yes they use That's why the tests are failing on CI. Are you saying the tests are failing locally for you when trying to force using the fallback? |
|
Pushed a new test for files within |
|
Related WordPress PR with the schema changes at WordPress/wordpress-develop#6825 I'll merge it shortly, to unblock CI tests here. |
|
Committed the schema changes at https://core.trac.wordpress.org/changeset/58412 I presume the CI test requires a re-triggering at some point for tests to pass. |
|
I have re-run the tests. |
|
@oandregal Looking at your core changeset, |
features/makepot.feature
Outdated
| And the foo-theme/foo-theme.pot file should contain: | ||
| """ | ||
| msgctxt "Style variation name" | ||
| msgid "My style variation" |
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.
This output doesn't match the input (My variation). Fixed at 8465789



Related PRs in this repo: #254 #292 #306
Related Gutenberg PR for this string: WordPress/gutenberg#62552
There's a new feature coming for WordPress 6.6 that allows theme authors to register block style variations through
theme.json. Block style variations have a label that is displayed to users, so it needs to be translated. I just found out that there is a missing place where the label wasn't picked from. This PR follows suit on what is done in Gutenberg at WordPress/gutenberg#62552 There's an upcoming WordPress core PR as well.Setup
Test
Before running any of the test (manual or automattic), make sure to set the
THEME_JSON_SOURCEto empty so theThemeJsonExtractorpicks the the local backup file with the changes atassets/theme-i18n.json.Automated tests:
Manual testing:
composer installfoo-themethat contains atheme.jsonfile with the following contents:{ "styles": { "blocks": { "variations": { "myVariation": { "title": "My variation", "blockTypes": [ "core/group" ], "color": { "background": "red" } } } } } }ember.jsonwithinfoo-theme/styles.jsonwith the following contents:{ "styles": { "blocks": { "variations": { "myVariation": { "title": "Other variation", "blockTypes": [ "core/group" ], "color": { "background": "red" } } } } } }vendor/bin/wp i18n make-pot foo-themefoo-theme/foo-theme.potfile and that the two variations labels are present as well as its context "Style variation name". You should see something like:Comments
This also needs a WordPress core PR. WordPress/gutenberg#62552 will be backported with the necessary changes.