-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Localize labels in getVisualTypeName() for link control search items #71503
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
Localize labels in getVisualTypeName() for link control search items #71503
Conversation
|
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. |
getdave
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. Very much appreciated.
Could we avoid changing the case of the labels in this PR? If we want to do that we can propose in a followup but it seems unrelated to the translation.
packages/block-editor/src/components/link-control/search-item.js
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/link-control/search-item.js
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/link-control/test/index.js
Outdated
Show resolved
Hide resolved
Since we removed the |
getdave
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this 👍
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…71503) * Localize labels in getVisualTypeName() for link control search items Fixes #71492 * Update LinkControl tests to expect localized post type labels * Ensure localized lowercase labels in getVisualTypeName * Refactor LinkControl to use unified TYPES object for icons and labels * Capitalize labels in TYPES object and test Co-authored-by: Adi-ty <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: dannyreaktiv <[email protected]>
…ordPress#71503) * Localize labels in getVisualTypeName() for link control search items Fixes WordPress#71492 * Update LinkControl tests to expect localized post type labels * Ensure localized lowercase labels in getVisualTypeName * Refactor LinkControl to use unified TYPES object for icons and labels * Capitalize labels in TYPES object and test Co-authored-by: Adi-ty <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: dannyreaktiv <[email protected]>

What?
Closes #71492
Localizes the labels shown in link control search items by fixing the
getVisualTypeName()function to use proper translatable strings instead of raw post type slugs.Why?
The link control search items were showing raw post type slugs that weren't translatable. Inconsistent capitalization handled via CSS transforms
How?
Added
__()translation functions for all user-facing strings