Skip to content
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: add title key to i18n schema #2483

Closed
wants to merge 1 commit into from
Closed

theme.json: add title key to i18n schema #2483

wants to merge 1 commit into from

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Mar 31, 2022

Trac ticket https://core.trac.wordpress.org/ticket/55495
This PR ports the related Gutenberg PR at WordPress/gutenberg#39936

What?

This PR adds title as a new key to translate from a theme.json file. It's necessary to fix the wp-cli i18n-command tests at wp-cli/i18n-command#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 wp-cli/i18n-command#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:

  • Go to "Settings > General" and set the language to Spanish.
  • Use TwentyTwentyTwo.
  • Load the site editor.
  • Verify that the color palettes names show up in Spanish (go to "Global Styles > Colors > Palette" and hover over the color circles.

@oandregal oandregal changed the title theme.json: add title key to translate theme.json: add title key to i18n schema Mar 31, 2022
@gziolo
Copy link
Member

gziolo commented Mar 31, 2022

Committed with 39a5bac.

@gziolo gziolo closed this Mar 31, 2022
@oandregal oandregal deleted the update/theme-json-i18n-schema branch March 31, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants