Fix: Use Core's item_link label for navigation link titles instead of…#76892
Fix: Use Core's item_link label for navigation link titles instead of…#76892adithya-naik wants to merge 3 commits intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @adithya-naik! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
dfdc422 to
0e6e79b
Compare
0e6e79b to
5415aa8
Compare
|
@ajitbohra / @fabiankaegy Could you please re-run the failed Playwright 3 job? It might be a flaky failure. |
Thanks! No need to re-run now. I triggered CI again with an empty commit and all checks have passed successfully, including the previously failing Playwright job. Performance tests also show no significant regression — all changes are within normal variance. |
|
Hi @ajitbohra and @fabiankaegy 👋 Following up on this PR. All CI checks are passing now, and the fix improves i18n by relying on Core’s item_link label instead of constructing "%s link" strings. This avoids incorrect translations across languages and aligns with existing Core behavior. Would love your feedback when you get a chance. Thanks! |
|
Just a Follow-up as its been too long |
Please do consider the PR |
What?
Remove the custom
sprintf( __( '%s link' ) )string frombuild_variation_for_navigation_link()and always use Core's existing
item_linklabel for navigation link titles.Why?
The previous code was:
item_linklabel from Core (e.g. "Page Link")$is_default_title)"%s link"stringThis broke translations in most languages because
"%s link"assumesEnglish word order. For example:
Core's
item_linklabel is already correctly translated into 50+ languagesby the WordPress translation team. There is no reason to override it.
Changes
$is_default_titlecondition from the title fallback checksprintf( __( '%s link' ), $singular )string$singularvariableitem_linkis genuinely absentBefore / After
Before:
After:
Testing Instructions
translated using Core's translations — not a raw
"%s link"patternFixes #76891