WordPress.org

Making WordPress.org

Opened 5 weeks ago

Last modified 3 weeks ago

#5779 new task

theme.json strings not extracted for translation

Reported by: nosolosw 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 (7)

#1 @nosolosw
5 weeks 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.


5 weeks ago

#3 @ocean90
5 weeks 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 @nosolosw
5 weeks 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.


5 weeks ago

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


4 weeks ago

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


3 weeks ago

Note: See TracTickets for help on using tickets.