Fix hardcoded plurals in count labels (use _n()) - #351
Merged
AllTerrainDeveloper merged 9 commits intoJul 14, 2026
Merged
Conversation
Use _n() instead of a hardcoded plural for the category node sidebar meta count in the Posts window Categories mind-map.
Use _n() for the category search-result count label in the Posts window Categories mind-map.
Use _n() instead of a hardcoded plural for the tag sidebar meta count in the Posts window Tags cloud.
Use _n() for the tag search-result count label in the Posts window Tags cloud.
Use _n() for the comment-count aria-label on post-list rows in the Posts window.
Use _n() for the direct-replies count on the Comments window replies toggle button.
Use _n( 'Reply (%d)', 'Replies (%d)', ... ) for the replies section label in the Content Graph panel, matching the existing pattern in the My WordPress window.
Use _n() for the pages-count sub-label on the Posts stats tile in the user Profile view.
Use _n() for the days-since-registration value in the user Profile stats grid.
AllTerrainDeveloper
approved these changes
Jul 14, 2026
AllTerrainDeveloper
left a comment
Collaborator
There was a problem hiding this comment.
Nice addition! Thank you!
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.
Summary
Several count labels across the Desktop Mode UI were built with a single hardcoded plural string via
__()+sprintf()instead of_n(), so at a count of 1 they render ungrammatically — e.g. "1 posts in this category.", "1 replies", "Replies (1)". This switches each to_n( singular, plural, number ).Spans the Posts window (Categories, Tags, post list, Profile), the Comments window, and the Content Graph — same defect class throughout. One fix per commit.
Fixes #350.
Changes
src/posts-window/categories-mindmap.ts%d posts in this category.src/posts-window/categories-mindmap.ts%d postssrc/posts-window/tags-cloud.ts%d posts tagged with this.src/posts-window/tags-cloud.ts%d postssrc/posts-window/index.ts%d commentssrc/comments-window/index.ts+ %d repliessrc/content-graph/panel.tsReplies (%d)src/posts-window/user-edit-render.ts+ %d pagessrc/posts-window/user-edit-render.ts%d daysThe Content Graph label now matches the already-correct
_n( 'Reply (%d)', 'Replies (%d)', … )insrc/my-wordpress/index.ts.Out of scope
Non-pluralizing / abbreviated
%dstrings are correct as-is and left untouched:%d selected,%d published,%d received,%d total,Approved %d.(no noun);%d KB,%d min/h/d ago,%d ★,%d / 100(abbreviations/scores);#%d,Desktop %d,%d:00(IDs/numbers); and the intentional%d post(s)/%d item(s)"(s)" shorthand. PHP%dstrings are HTTP/error codes, not counts.Testing
npm run build— cleannpm run lint— cleannpm run typecheck— cleannpm run test:js— 1821 passedNo POT/PO regeneration (batched i18n step, per contributor guide).