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

Add duotone and dimensions to the block level for translation #68243

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Dec 23, 2024

Follow-up to #66675
Core backport at https://github.com/WordPress/wordpress-develop/pull/8031/files

What?

Make duotone and aspect ratios translatable to the block level (details).

Why?

Without this, the strings are not translatable.

How?

Adds duotone & aspect ratios under settings/blocks/*, so strings defined at these places are extracted for translation.

Testing Instructions

None. This will be picked by the wp-cli/i18n-command when merged in wordpress-develop.

Copy link

github-actions bot commented Dec 23, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: oandregal <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: swissspidy <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@oandregal oandregal self-assigned this Dec 23, 2024
@oandregal oandregal added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts labels Dec 23, 2024
@oandregal oandregal force-pushed the update/theme-i18n-block branch from e6a7212 to f4d8ef2 Compare December 23, 2024 11:58
@swissspidy
Copy link
Member

@oandregal I wonder, how can we prevent this (forgetting to make these strings translatable) from happening in the future? A CI workflow or lint script would be useful IMO.

Copy link

Flaky tests detected in f4d8ef2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12466419429
📝 Reported issues:

@oandregal oandregal enabled auto-merge (squash) December 23, 2024 15:45
@oandregal oandregal merged commit dad1fab into trunk Dec 23, 2024
64 checks passed
@oandregal oandregal deleted the update/theme-i18n-block branch December 23, 2024 15:48
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Dec 23, 2024
@oandregal
Copy link
Member Author

I wonder, how can we prevent this (forgetting to make these strings translatable) from happening in the future? A CI workflow or lint script would be useful IMO.

Yeah, judging by the number of misses, I agree this is an area that needs to raise more awareness.

I'm happy to help with this, but I'm not sure how the lint would work, though. There are heuristics, but they are a bit weak: arrays present in settings within lib/theme.json? But there false positives. Or perhaps properties named name? But you can really name it anything you want. 🤔

@swissspidy
Copy link
Member

Or maybe just some bot telling you to maybe update the schema file, just like it does for changelog files?

@oandregal
Copy link
Member Author

Or maybe just some bot telling you to maybe update the schema file, just like it does for changelog files?

Oh, nice.

Could it work this way? Every change in theme.json will trigger the CI job and will fail if the new property added in theme.json is not in theme-i18n.json unless it has been added to a list of properties not to translate. We could bootstrap the initial list. It'd be even better if this was just part of the theme.json schema. cc @ajlende as it sounds something right up your alley :)

I'm not sure I'll have time to look at this before end of year given holidays, etc. but it sounds interesting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants