Skip to content

🐛 Fixed comment count not respecting theme translations - #1088

Merged
minimaluminium merged 1 commit into
TryGhost:mainfrom
pjornrachzark:fixed-translatable-comment-count
Oct 19, 2026
Merged

minimaluminium merged 1 commit into
TryGhost:mainfrom
pjornrachzark:fixed-translatable-comment-count

Conversation

@pjornrachzark

Copy link
Copy Markdown
Contributor

Post cards render the comment count with the bare {{comment_count}} helper. That helper falls back to the hardcoded English comment/comments defaults, so the count is always displayed in English regardless of the site's publication language.

This fix pass singular / plural through the {{t}} helper, using the same translation pattern already applied to reading_time on the line above.

FYI: The same bare {{comment_count}} pattern appears in other official themes (Edition, Solo, Headline).

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The post card footer's comment count display in partials/post-card.hbs was updated to use a pluralization-aware helper call with singular ("comment") and plural ("comments") translation labels, replacing the direct output of the raw comment_count value.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Changes

File Summary
partials/post-card.hbs Changed comment_count rendering to use singular/plural translation arguments

Related issues: None provided.

Related PRs: None provided.

Suggested labels: None provided.

Suggested reviewers: None provided.

🐰 A single comment, now two or more,
Translated neatly, singular no more,
One tiny line, a pluralized delight,
Hop along, the count reads just right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: comment count translation behavior in post cards.
Description check ✅ Passed The description matches the changeset and explains the translation-helper fix and context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@honhatduy

Copy link
Copy Markdown

@9larsons This should be fix for all official themes, too!

@minimaluminium

Copy link
Copy Markdown
Member

Agreed, thanks for flagging this! Let’s keep this PR focused on Casper and follow up with separate fixes for the affected usages in other themes.

- post cards used the bare {{comment_count}} helper, which falls back to the hardcoded English "comment"/"comments" defaults regardless of the publication language

- the comment/comments keys already exist in every locale file but were never wired into the helper call, so translations had no effect

- pass singular/plural through the {{t}} helper, mirroring the reading_time helper on the line above
@minimaluminium
minimaluminium force-pushed the fixed-translatable-comment-count branch from 4c45d5b to 6969279 Compare October 19, 2026 12:28
@minimaluminium
minimaluminium merged commit 234d9f1 into TryGhost:main Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants