Translate "description" field from theme.json #408
Merged
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.
This PR:
Important
A WordPress Core PR exists to add the "description" key to
src/wp-includes/theme-i18n.json
. This has not yet been committed.TODO
Context
A "description" key was added to theme.json in WordPress/gutenberg#45242
The Gutenberg PR was synced to Core in WordPress/wordpress-develop#4687
Unfortunately, a corresponding entry to the theme.json i18n schema was not part of the change.
Core trac ticket: https://core.trac.wordpress.org/ticket/61543
Testing
Set up
Before running any of the test (manual or automatic), make sure to set the
THEME_JSON_SOURCE
to '' (empty string) so theThemeJsonExtractor
picks the the local backup file with the changes atassets/theme-i18n.json
.Automated tests:
Manual tests:
Create a new directory called
foo-theme
that contains a theme.json file with the following contents:Run
vendor/bin/wp i18n make-pot foo-theme
Verify that there's a
foo-theme/foo-theme.pot
file and that the "My style variation description" string is present as well as its context "Style variation description".You should see something like: