Open yuliyan opened 2 weeks ago
Hi @swissspidy, upon reviewing this issue, we discovered that limiting the extractor to only work with the top-level theme.json
has caused the bug. Could you provide some insight into why this change was implemented in this commit: https://github.com/wp-cli/i18n-command/commit/345eb7a88443d4db63a8d8e7c7aac935fb197392? We are considering loosening this restriction but are concerned about potential side-effects you might be aware of.
Well, it's simple. theme.json
are for block themes and must live in the root folder of a block theme. With this in place, the string extraction is much faster as there is no point in scanning every other directory for such a file.
Plugins normally don't include a theme.json
file. Gutenberg is the exception because the format is developed here.
I'd rather suggest Gutenberg moving the file location, that would be the simpler solution.
Description
The strings from the
lib/theme.json
are not being extracted for translation, likely due towp i18n make-pot
command being limited to only scanning thetheme.json
file in the root of the plugin/theme or the JSON files instyles/*.json
.As a results some of the strings, such as the aspect ratio options, the drop shadow presets, etc., are not available for translation in the GlotPress project and thus the strings appear untranslated in the block editor (see the attached screenshots).
Step-by-step reproduction instructions
wp i18n make-pot .
.gutenberg.pot
file to confirm strings fromlib/theme.json
are not being extracted.Screenshots, screen recording, code snippet
Aspect ratio options:
Drop shadow presets:
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.