#55495 closed enhancement (fixed)
Translate global style variations
Reported by: | oandregal | Owned by: | oandregal |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
WordPress 6.0 is adding the concept of style variations to Global Styles. These are separate theme.json
files that provide a different set of styles.
There're a few things we need to do to be able to translate what they provide:
- make the
title
key from anytheme.json
translatable- requires changes to wp-cli i18n command
- update the i18n schema available in core
- make wp-cli's i18n-command look for
theme.json
files under thestyles/
folder of a theme (in addition to what it now does of looking in the top-level folder)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Trac ticket https://core.trac.wordpress.org/ticket/55495
This PR ports the related Gutenberg PR at https://github.com/WordPress/gutenberg/pull/39936
## What?
This PR adds
title
as a new key to translate from atheme.json
file. It's necessary to fix the wp-cli i18n-command tests at https://github.com/wp-cli/i18n-command/pull/306## Why?
The
title
key from a style variation is shown to the user, hence, it needs to be translatable.## How?
By adding the key to the i18n schema we allow the i18n-command from the wp-cli to pick it up. See https://github.com/wp-cli/i18n-command/pull/306 Though the wp-cli uses the schema from WordPress
trunk
so we also need to port the changes there.## Testing Instructions
This PR only prepares the code for the wp-cli to pick up translations, so there's nothing to test other than verifying that it doesn't break anything. This is what I did: