Block Directory: Make downloadable block item labels translatable. - #81237
Merged
jorgefilipecosta merged 2 commits intoAug 6, 2026
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. |
|
Size Change: -9 B (0%) Total Size: 7.81 MB 📦 View Changed
|
jorgefilipecosta
force-pushed
the
fix/block-directory-untranslatable-labels
branch
from
August 5, 2026 20:42
04f63db to
ea3240b
Compare
Mamaduka
approved these changes
Aug 6, 2026
Mamaduka
left a comment
Member
There was a problem hiding this comment.
Good catch, @jorgefilipecosta!
It's odd that these went unnoticed for so long.
talldan
pushed a commit
that referenced
this pull request
Aug 6, 2026
…81237) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
amitraj2203
pushed a commit
that referenced
this pull request
Aug 10, 2026
…81237) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
shail-mehta
pushed a commit
that referenced
this pull request
Aug 12, 2026
…81237) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the four downloadable block item labels in the Block Directory that could not be translated.
The
getDownloadableBlockLabelhelper indownloadable-block-list-itempasses its format strings straight tosprintfwithout wrapping them in__(). The translator comments are in place, but because the strings never go through an i18n function they are not extracted for translation and always render in English. These are the "Install %s.", "Add %s.", "Installing %s." and "Retry installing %s." labels used for the tooltip and the accessible label of each result in the inserter's Block Directory search.To fix this we wrap the four format strings in
__(), matching the_n()call already used for the rated variant in the same function. A sweep of the repository did not turn up this pattern anywhere else — the remaining unwrappedsprintfcalls are developer-facing error messages, HTMLidattributes, or code samples, which should not be translated.Testing Instructions
npm run test:unit -- packages/block-directoryand verify the tests pass.packages/block-directory/src/components/downloadable-block-list-item/index.jsare wrapped in__()with their translator comments, so they get extracted for translation.AI usage disclosure: fix and description drafted with AI assistance and reviewed by me.