Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#55495 closed enhancement (fixed)

Translate global style variations

Reported by: oandregal's profile oandregal Owned by: oandregal's profile 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 any theme.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 the styles/ folder of a theme (in addition to what it now does of looking in the top-level folder)

Change History (4)

This ticket was mentioned in PR #2483 on WordPress/wordpress-develop by oandregal.


2 years ago
#1

  • Keywords has-patch added

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 a theme.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:

  • 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.

#3 @gziolo
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Committed with [53038].

#4 @gziolo
2 years ago

  • Milestone changed from Awaiting Review to 6.0
Note: See TracTickets for help on using tickets.