Skip to content

🌐 Enable theme translations for Casper#1028

Merged
cathysarisky merged 1 commit into
mainfrom
t-string-wrapping
Mar 6, 2026
Merged

🌐 Enable theme translations for Casper#1028
cathysarisky merged 1 commit into
mainfrom
t-string-wrapping

Conversation

@cathysarisky
Copy link
Copy Markdown
Member

This PR wraps Casper's translatable strings in the t helper. I've opted to swap "zero" for "0", to match other themes and reduce translator workload, and not to translate "Message" and "Ref" that appear only on the non-404 error template.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 6, 2026

Walkthrough

This pull request adds internationalization (i18n) support across multiple Handlebars template files in a Ghost theme. Hard-coded UI text strings are systematically replaced with translation helper calls using the {{t "..."}} syntax. Changes affect six template files: default.hbs (header and footer labels), error-404.hbs and error.hbs (error page text), partials/post-card.hbs (post metadata and badges), post.hbs (post header and byline), and tag.hbs (collection description). Most replacements are straightforward string-to-translation conversions, with one notable exception in tag.hbs where static text is replaced with a pluralized translation expression supporting zero, singular, and plural forms.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the PR's purpose of wrapping translatable strings in the t helper, with specific implementation details about handling zero forms and exclusions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main change: enabling theme translations for the Casper theme by wrapping translatable strings with the t helper across multiple template files.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch t-string-wrapping

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 changed the title add string wrapping 🌐 Enable theme translations for Casper Mar 6, 2026
@cathysarisky cathysarisky merged commit 4950217 into main Mar 6, 2026
1 check passed
@cathysarisky cathysarisky deleted the t-string-wrapping branch March 6, 2026 17:58
nirajsanghvi pushed a commit to nirajsanghvi/casper_niraj that referenced this pull request Mar 14, 2026
#2)

* Updated date formatting

ref DES-937

- updated the format to DD MMM YYYY which is the preferred format in Ghost

* v5.8.1

* 2025

Co-authored-by: Hannah Wolfe github.erisds@gmail.com

* Added support for additional social links (TryGhost#991)

ref https://linear.app/ghost/issue/PLG-413/add-helpers-to-official-themes

* Added support for all of the new social links in Ghost
* Added icon classes to social icons so that we can display an icon for each link
* Switched to using the new social_url helper for all social links as it is cleaner
* Replaced Twitter with X logo so it's up to date

* Update dependency gscan to v4.48.0 (TryGhost#980)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Updated `caniuse-lite` browser list (#22907) (TryGhost#992)

- Running the yarn test command was logging a bunch of
warnings because our browser list hadn't been updated in 6 months

```
Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
```

- This commit fixes the warnings by updating the browsers list by
running `npx update-browserslist-db@latest` in the root of the repo, and
committing the result.

* Revert "Updated `caniuse-lite` browser list (#22907) (TryGhost#992)"

- This reverts commit e151531.
- This change results in further changes when running gulp build that will need verifying separately

* v5.9.0

* Update dependency gscan to v4.49.1

* Fixed line height issue for sub and sup elements

* Update dependency gscan to v5 (TryGhost#999)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency postcss to v8.4.31 [SECURITY] (TryGhost#961)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update CSS preprocessors (TryGhost#885)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency inquirer to v8.2.7 (TryGhost#905)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency pump to v3.0.3 (TryGhost#983)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency gulp to v5 (TryGhost#977)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update CSS preprocessors (TryGhost#932)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency gulp-postcss to v10 (TryGhost#973)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency gulp-zip to v6 (TryGhost#964)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency inquirer to v13 (TryGhost#1008)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Lock file maintenance (TryGhost#814)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency inquirer to v13.2.0 (TryGhost#1012)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Lock file maintenance (TryGhost#1013)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Lock file maintenance (TryGhost#1014)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* 2026

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>

* Update dependency gscan to v5.2.4 (TryGhost#1015)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency inquirer to v13.2.1 (TryGhost#1016)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency inquirer to v13.2.2 (TryGhost#1017)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency autoprefixer to v10.4.24 (TryGhost#1019)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Lock file maintenance (TryGhost#1020)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update README.md

* Add translations section to README (TryGhost#1026)

Added section on translations and contribution guidelines.

* Update translation contribution guidelines (TryGhost#1027)

Fixed error (wrong repo name - removed)

* 🌐 Enable theme translations for Casper (TryGhost#1028)


ref #23361

* add locale files (TryGhost#1030)

* Updated gulpfile and dependencies for building i18n files (TryGhost#1029)

ref TryGhost@63162e8

The above commit pushed the locales slightly ahead of this. Running the gulp file generates the locale files.

* Update theme asset builds (TryGhost#1031)

* update asset builds

* Ship v5.10.0 - now with translations enabled! (TryGhost#1032)

* fix Casper's postship (TryGhost#1033)

* Initial plan

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
Co-authored-by: John O'Nolan <john@onolan.org>
Co-authored-by: Sanne de Vries <65487235+sanne-san@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
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