Skip to content

Conversation

@cathysarisky
Copy link
Member

@cathysarisky cathysarisky commented Dec 10, 2025

This PR includes t wrapping of (I think) all text strings in Source.


Note

Low Risk
Mostly template-string changes to enable Ghost theme i18n; risk is limited to potential missing/incorrect translation keys causing odd labels or title formatting.

Overview
Sets up theme internationalization by adding locales/en.json and wrapping previously hardcoded UI strings across templates/partials with the {{t}} helper (navigation, footer, featured/posts lists, search, lightbox, and subscription form).

Updates a few dynamic strings to use translated variants/formatting, including meta_title pagination text, reading_time singular/plural labels, and the footer “Powered by …” string via an interpolated ghostlink.

Written by Cursor Bugbot for commit 14d533c. This will update automatically on new commits. Configure here.

@cursor
Copy link

cursor bot commented Dec 10, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 3.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@muratcorlu
Copy link

@JohnONolan Do we still have any blockers to start translating Official Themes?

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Walkthrough

This PR adds localization by replacing hard-coded UI strings with the t translation helper across templates and partials, and adds a new locales/en.json file containing 42 translation keys with empty values. Affected files include default.hbs, post.hbs, and partials under partials/components (featured, footer), header-content, navigation, post-list, email-subscription, lightbox, post-card, search-toggle. No control flow, business logic, or public/exported API declarations were changed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Set up Source for translation' accurately describes the main objective of wrapping UI strings with the translation helper and adding locale support.
Description check ✅ Passed The description clearly explains that the PR wraps text strings with the {{t}} translation helper and adds locales/en.json for Ghost theme i18n setup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@private.hbs`:
- Around line 51-55: The password input lacks an accessible label—update the
template around the gh-signin form to provide one by either adding a <label>
tied to the input's id or adding an aria-label to the input_password helper; for
example ensure the input_password call includes a stable id (e.g.,
id="password") and either render <label for="password">{{t "Password"}}</label>
before it or add aria-label=(t "Password") to the input_password invocation so
screen readers can identify the field.
🧹 Nitpick comments (3)
partials/email-subscription.hbs (1)

2-4: Consider whether the email placeholder needs translation.

The ARIA label and button text localization is correct. However, localizing the placeholder email address (jamie@example.com) is uncommon—example email addresses are typically left as universal patterns since email format is the same across locales. Unless there's a specific requirement for locale-specific example names, you might consider keeping this as a static placeholder.

That said, this is a minor stylistic choice and the current approach works correctly.

private.hbs (1)

31-33: Allow user zoom in the viewport meta.

Disabling zoom hurts accessibility on mobile. Consider removing user-scalable=no and maximum-scale=1.

Proposed change
-        <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
partials/pagination.hbs (1)

1-8: Add aria-label on the nav and rel on prev/next links.
Improves accessibility and SEO without changing behavior.

Proposed diff
-<nav class="pagination">
+<nav class="pagination" aria-label="{{t "Pagination"}}">
     {{`#if` prev}}
-        <a class="newer-posts" href="{{page_url prev}}"><span aria-hidden="true">&larr;</span> {{t "Newer Posts"}}</a>
+        <a class="newer-posts" href="{{page_url prev}}" rel="prev"><span aria-hidden="true">&larr;</span> {{t "Newer Posts"}}</a>
     {{/if}}
     <span class="page-number">{{t "Page {page} of {totalPages}" page=page totalPages=pages}}</span>
     {{`#if` next}}
-        <a class="older-posts" href="{{page_url next}}">{{t "Older Posts"}} <span aria-hidden="true">&rarr;</span></a>
+        <a class="older-posts" href="{{page_url next}}" rel="next">{{t "Older Posts"}} <span aria-hidden="true">&rarr;</span></a>
     {{/if}}
 </nav>

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@locales/en.json`:
- Around line 1-42: The locales/en.json contains 42 keys but only five are
actually referenced in templates ("1 min read", "% min read", "Page %", "Read
more", "Search this site"); confirm intent for the other 37 keys and either (a)
remove the unused keys from locales/en.json to avoid dead translations, (b) move
them to a separate archive or documentation file (e.g., unused_locale_keys.json)
if you want to keep them for future features, or (c) add a clear comment/README
entry describing which keys are intentionally retained for planned features;
update the file so it only contains the five active keys (above) or clearly
marks retained keys and their purpose.
🧹 Nitpick comments (2)
locales/en.json (2)

17-18: Clarify the purpose of two different "Page" translation keys.

There are two "Page" related keys with different placeholder patterns:

  • "Page {page} of {totalPages}" - uses named placeholders
  • "Page %" - uses single unnamed placeholder

If both are needed for different contexts (e.g., full pagination vs. abbreviated), this is fine. However, if they serve the same purpose, consider consolidating to avoid translator confusion.


11-11: Example email as translation key is unconventional but acceptable.

Using jamie@example.com as a key works for placeholder text, but translators may find it confusing since it looks like actual content rather than a UI string pattern. Consider using a more descriptive key like "email placeholder" if Ghost's translation system supports it, or document its purpose for translators.

@cathysarisky cathysarisky requested a review from 9larsons February 5, 2026 15:58
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

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.

2 participants