You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
brew install jq mysql
brew service start mysql
mysql_secure_installation
sudo mysql -u root -p
# MySQL Session
CREATE DATABASE IF NOT EXISTS `wp_cli_test`;
CREATE USER 'wp_cli_test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password1';
GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost";
\q
Test
Before running any of the test (manual or automattic), make sure to set the THEME_JSON_SOURCE to empty so the ThemeJsonExtractor picks the the local backup file with the changes at assets/theme-i18n.json.
Verify that there's a foo-theme/foo-theme.pot file and that the two variations labels are present as well as its context "Style variation name". You should see something like:
This is the first I've setup a wp-cli command env locally so have limited context around how this should be done. Please take the following with a grain of salt 🙂
✅ Setting up the env went smoothly
✅ This PR manually tests as advertised following test instructions directly
✅ The generated pot file looks to contain the desired data
❓ The automated tests do fail locally for me as well
Why is this kind of stuff happening so late in the cycle? 🤔
This is probably due to an oversight of mine, sorry.
There was a bug fix required for the new section styles feature so that keys in the theme.json could reliably be presumed to be slugs and prevent an apparent duplication of the style within the UI.
It‘s because this change is not in core trunk yet.
How the behat tests find the schema? Don't they use the THEME_JSON_SOURCE? I've set that constant to empty (so, supposedly, it's using the local file with the updated property) but the test still fails 🤔
I've pushed a couple of fixes to the test: c918b7a and 8465789. It's now passing for me locally (both setting THEME_JSON_SOURCE to empty to use the local assets and leaving it as it is to use the remote one from core).
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_SOURCE
to empty so theThemeJsonExtractor
picks the the local backup file with the changes atassets/theme-i18n.json
.Automated tests:
Manual testing:
composer install
foo-theme
that contains atheme.json
file with the following contents:ember.json
withinfoo-theme/styles.json
with the following contents:vendor/bin/wp i18n make-pot foo-theme
foo-theme/foo-theme.pot
file 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.