Skip to content

🐛 Fixed comment count not respecting theme translations - #1088

Open
pjornrachzark wants to merge 1 commit into
TryGhost:mainfrom
pjornrachzark:fixed-translatable-comment-count
Open

🐛 Fixed comment count not respecting theme translations#1088
pjornrachzark wants to merge 1 commit into
TryGhost:mainfrom
pjornrachzark:fixed-translatable-comment-count

Conversation

@pjornrachzark

Copy link
Copy Markdown

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).

- 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
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5ff87ba1-37f6-431d-8afd-668a92885ae5

📥 Commits

Reviewing files that changed from the base of the PR and between 6e27f62 and 4c45d5b.

📒 Files selected for processing (1)
  • partials/post-card.hbs

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant