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

fix make dimensions.aspectRatios key of theme.json files translatable #61774

Merged
merged 3 commits into from
May 22, 2024

Conversation

fabiankaegy
Copy link
Member

What?

Make Aspect Ratio preset names in theme.json translatable.

Why?

Closing #61767

How?

Adding the schema to the theme-i18n.json file.

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@fabiankaegy fabiankaegy added Internationalization (i18n) Issues or PRs related to internationalization efforts Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels May 18, 2024
@fabiankaegy fabiankaegy self-assigned this May 18, 2024
@fabiankaegy fabiankaegy linked an issue May 18, 2024 that may be closed by this pull request
Copy link

github-actions bot commented May 18, 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: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@fabiankaegy fabiankaegy added the [Type] Bug An existing feature does not function as intended label May 18, 2024
@fabiankaegy
Copy link
Member Author

@swissspidy I also updated the PR in core to include this: WordPress/wordpress-develop@ddc6877

Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/theme-i18n.json

@Mamaduka
Copy link
Member

@fabiankaegy, @swissspidy, what are the testing instructions for theme-i18n.json changes?

@fabiankaegy
Copy link
Member Author

@Mamaduka I am unsure myself sadly. I just followed the code examples and looked at a few other PR's that implemented it

@swissspidy
Copy link
Member

Manually updating translation files & then verifying that the strings are transkated woukd be one option.

@t-hamano
Copy link
Contributor

t-hamano commented May 20, 2024

If I understand correctly, theme-i18n.json exists to make preset labels translatable, right?

I tried testing existing presets, but for some reason they don't translate.

For example, color presets are translated into Japanese on GlotPress:

https://translate.wordpress.org/projects/wp-themes/twentytwentyfour/ja/default/?filters%5Bterm%5D=Accent&filters%5Bterm_scope%5D=scope_originals&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=original&sort%5Bhow%5D=asc

image

But when I change the site language to Japanese, the color palette is not translated 🤔

image

@ajlende ajlende added the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label May 22, 2024
Copy link
Contributor

@ajlende ajlende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm aware, this is the only setting that should control i18n for theme.json. I'm going to get this merged for the 18.4 release, but I think it's worthwhile looking into the issue of it not working even for the pre-existing color palette that @t-hamano shared above.

@ajlende ajlende force-pushed the fix/make-aspect-ratio-in-theme-json-translatable branch from 1ad43f1 to 6d89977 Compare May 22, 2024 21:37
@ajlende ajlende enabled auto-merge (squash) May 22, 2024 21:38
Copy link

Flaky tests detected in 6d89977.
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/9198731152
📝 Reported issues:

@ajlende ajlende merged commit cc2fcbe into trunk May 22, 2024
62 checks passed
@ajlende ajlende deleted the fix/make-aspect-ratio-in-theme-json-translatable branch May 22, 2024 22:12
@github-actions github-actions bot added this to the Gutenberg 18.5 milestone May 22, 2024
ajlende pushed a commit that referenced this pull request May 22, 2024
…#61774)

Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
@ajlende
Copy link
Contributor

ajlende commented May 22, 2024

I just cherry-picked this PR to the release/18.4 branch to get it included in the next release: 5d68089

@ajlende ajlende removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label May 22, 2024
https://github.com/WordPress/wordpress-develop/pull/6567

* https://github.com/WordPress/gutenberg/pull/47271
* https://github.com/WordPress/gutenberg/pull/61774
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ❤️

"name": "Aspect ratio name"
}
]
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be backported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json 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.

Aspect ratio preset names are not translatable
6 participants