Add new field to translate in theme.json#292
Merged
schlessera merged 1 commit intowp-cli:masterfrom Dec 2, 2021
oandregal:add/new-field-to-translate
Merged
Add new field to translate in theme.json#292schlessera merged 1 commit intowp-cli:masterfrom oandregal:add/new-field-to-translate
theme.json#292schlessera merged 1 commit intowp-cli:masterfrom
oandregal:add/new-field-to-translate
Conversation
schlessera
approved these changes
Dec 2, 2021
Member
|
Thanks for the PR, @oandregal ! |
Contributor
Author
|
ok, that was fast 😅 I was about to push a tweak to the behat tests to include this case. Also, I was waiting until the Gutenberg PR that uses it at WordPress/gutenberg#37038 was merged, to be 100% certain this was a change we needed. If we're aiming to release 2.5.1 these days, I guess is fine to go ahead with this change. In the worst-case scenario (Gutenberg PR doesn't get merged), we'd need to remove this key in the future, but with no urgency as everything will work as expected. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on WordPress/gutenberg#37038
In WordPress/gutenberg#37038 Gutenberg is adding a new field to translate for the font sizes stored within a
theme.json. This PR adds it to the i18n command.Setup
sudo apt install jq mysql-server mysql-client php-mysqlcomposer install && composer behat=> it didn't setup the database for me (mysql 8) so I did;sudo mysql -u rootCREATE DATABASE IF NOT EXISTSwp_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"How to test
composer installThemeJsonExtractor.phpby substituting the line 148$json = self::remote_get( self::THEME_JSON_SOURCE );by$json = '';.foo-themeand create atheme.jsonfile within with the following contents:{ "version": "2", "settings": { "typography": { "fontSizes": [ { "slug": "small", "size": "12px", "name": "Small", "alias": "S" } ] } } }vendor/bin/wp i18n make-pot foo-themefoo-theme/foo-theme.potfile and that it has the name and alias strings: