WordPress.org

Making WordPress.org

Opened 4 months ago

Last modified 4 days ago

#5779 reopened task

theme.json strings not extracted for translation

Reported by: oandregal Owned by:
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords:
Cc:

Description

https://core.trac.wordpress.org/ticket/53175 landed support for theme.json in WordPress 5.8, which is used by both core and themes to provide a number of settings to the block editor. The presets visible to users are among those settings: color palette, font sizes, duotone, etc.

Before the introduction of theme.json, themes would mark these strings for being extracted in their functions.php file. Now, those strings should be taken from the theme.json file instead, as we do with block.json strings https://meta.trac.wordpress.org/ticket/5737

How to test

  • Went to https://translate.wordpress.org/ and selected the 5.7.x line.
  • Searched for something that was present in a previous release but used a different source for translation (the block-editor package): "font size name".
  • Searched for something that is new to 5.8: "duotone", "duotone name", or a specific value such as "dark grayscale".
    • I can't find anything.

How to fix

As far as I understand, we need to do a couple of things:

Change History (10)

#1 @oandregal
4 months ago

I've prepared a pull request to add support for this in wp-cli at https://github.com/wp-cli/i18n-command/pull/254

This ticket was mentioned in Slack in #core-editor by nosolosw. View the logs.


4 months ago

#3 @ocean90
4 months ago

  • Type changed from defect to task

Went to https://translate.wordpress.org/ and selected the 5.7.x line.

Why are you expecting strings from WordPress 5.8 in a project named 5.7.x?

Note that you have linked to theme-i18n.json file and not theme.json (both exists).

#4 @oandregal
4 months ago

Why are you expecting strings from WordPress 5.8 in a project named 5.7.x?

Where should I look for this? I haven't found a 5.8 project so I presumed the latest would be used instead?

Note that you have linked to theme-i18n.json file and not theme.json (both exists).

theme-i18.json is used as a helper to know which paths from theme.json need translation plus provide the translation context for them.

This ticket was mentioned in Slack in #core-editor by nosolosw. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-editor by nosolosw. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-editor by paaljoachim. View the logs.


4 months ago

#8 @oandregal
3 months ago

Just checked the current status of this:

  • Following the instructions in the description (but using the 5.8.x) line, I can see the strings up for translation, so it's working as expected.

Can anyone confirm the meta setup has been updated with the latest version of i18n-command? cc @ocean90

#9 @ocean90
12 days ago

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

This was fixed a while ago.

#10 @oandregal
4 days ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

@ocean90 I was checking this and wanted to share that this is working for WordPress core but it isn't for plugins and themes.

The PR to implement this in wp-cli landed a while ago but the wp-cli version that contains it (2.5.1) hasn't been released yet. Thought I'd mention it, although I don't know if that's what's happening here or there's any other issue at play.

Note: See TracTickets for help on using tickets.