Skip to content

✨🌐 Make the Source theme translatable#123

Merged
cathysarisky merged 10 commits intomainfrom
i18n-wrapping-part2
Mar 4, 2026
Merged

✨🌐 Make the Source theme translatable#123
cathysarisky merged 10 commits intomainfrom
i18n-wrapping-part2

Conversation

@cathysarisky
Copy link
Copy Markdown
Member

@cathysarisky cathysarisky commented Mar 4, 2026

This PR adds translation wrapping to all strings in Source.


Note

Low Risk
Primarily replaces static strings with translation helpers in templates; low functional risk aside from potential missing/incorrect translation keys affecting displayed text.

Overview
Makes the Source theme translatable by wrapping hard-coded UI copy in Handlebars {{t}} helpers across templates and partials.

This includes the document title pagination suffix, navigation/search/menu labels, membership actions (sign in/subscribe/account/upgrade), feed headings/CTAs (Latest/See all/Read more/Featured/Recommendations), and various accessibility strings (aria-labels and lightbox button titles), plus localized reading_time singular/plural formatting.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This pull request adds internationalization (i18n) support across multiple Ghost theme template files by replacing hard-coded static strings with translation helper function calls. The changes systematically wrap user-facing text in titles, navigation, buttons, form elements, and component labels with the translation helper (t "..."). Approximately 38 lines are modified across 11 template files. No structural changes, conditional logic modifications, or control flow alterations are introducedβ€”only text localization is updated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

πŸš₯ Pre-merge checks | βœ… 3
βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately summarizes the main change: adding translation support to the Source theme by wrapping strings with translation helpers.
Description check βœ… Passed The description is directly related to the changeset, explaining that translation wrapping is being added to strings across the Source theme templates.
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
  • Commit unit tests in branch i18n-wrapping-part2

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@cathysarisky cathysarisky merged commit 8243141 into main Mar 4, 2026
1 of 2 checks passed
@bst1n
Copy link
Copy Markdown

bst1n commented Mar 5, 2026

@cathysarisky should we help here ?

Quite a bit of work had already been done here:https://github.com/SourceTheme-i18n/Source

Surely we could reuse it?

@cathysarisky
Copy link
Copy Markdown
Member Author

Hey @bst1n ! Yes, I will want help soon, including moving over all the great translator work from the SourceThem-i18n project!

The architecture is going to be a little bit different. Translation strings are going to live in the themes repo (within the theme-translations folder), so that we can translate once and then have that work available to all official themes.

If you'd like to contribute immediately, what would be most helpful would be a comparison between Source and SourceTheme-i18n for anywhere the wrapping is different. If there's anywhere that the wrapping is better in the fork, let's get that over into this repo.

I'll announce when we're ready for translations over on the Ghost forum. Very soon, but we need to finalize all the string wrapping before people start translating.

@bst1n
Copy link
Copy Markdown

bst1n commented Mar 6, 2026

Comparison: Official Source (post-PR #123) vs SourceTheme-i18n Fork

Hi @cathysarisky! I did a full comparison of the {{t}} string wrapping between this repo (after your PR) and the SourceTheme-i18n fork. Here's what I found:

1. Official Source wraps strings the fork missed βœ…

String File Notes
aria-label="{{t "Menu"}}" navigation.hbs:13 Fork has hard-coded "Menu"
aria-label="{{t "Subscribe"}}" email-subscription.hbs:3 Fork has hard-coded "Subscribe"
{{meta_title page=(t " (Page %)")}} default.hbs:6 Fork has no pagination suffix translation at all

2. Fork has a content-cta.hbs partial β€” but the official approach seems better

The fork adds a partials/content-cta.hbs to translate paywall/content-gating messages ("This content is for paying subscribers only", "Upgrade your account", "Already member?", etc.).

However, the official en.json already includes Ghost core-rendered paywall strings ("This post is for paying subscribers only", "This page is for...", etc.) that don't appear in any .hbs template β€” suggesting Ghost renders them internally using the theme's locale file. The official approach seems better because:

  • It distinguishes post vs page context (the fork uses generic "content" for both)
  • It uses proper {tiers} interpolation inside the string ("This post is for subscribers on the {tiers} only"), which is better for i18n since word order varies by language. The fork appends {{tiers}} after the string.
  • The fork has a bug: the string "This content is for subscribers on the following tiers only:" is used in the template but missing from the fork's en.json

One caveat: I'm assuming Ghost core actually reads those paywall strings from the theme's locale files. If that's not the case, the fork's content-cta.hbs approach would have value. Could you confirm?

3. Locale file coverage

The official en.json includes 16 additional strings not in the fork's en.json β€” all Ghost core strings for private sites, pagination, and paywalls (e.g., "Access site", "Password", "This site is private.", "Newer Posts", "Older Posts", "Page {page} of {totalPages}", "Subscribe now", " and ").

Conclusion

I didn't find any wrapping in the fork that's better than the official Source. The official is strictly ahead on template wrapping (3 strings the fork missed) and handles paywall strings more cleanly through Ghost core's locale system.

The fork's real value is in its community translations (de, fr, nl, sv, etc.) β€” which I understand will be handled separately via the theme-translations folder.

Happy to help with next steps when you're ready! πŸ™Œ

@cathysarisky cathysarisky deleted the i18n-wrapping-part2 branch March 6, 2026 21:07
adenau pushed a commit to adenau/technodabbler-source-theme that referenced this pull request Mar 29, 2026
no ref

* wrap all the strings!
* built tools coming separately.
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