Skip to content

Added translation for gift subscription product in Stripe#28065

Merged
mike182uk merged 2 commits into
mainfrom
fix/ONC-1759
May 26, 2026
Merged

Added translation for gift subscription product in Stripe#28065
mike182uk merged 2 commits into
mainfrom
fix/ONC-1759

Conversation

@sagzy
Copy link
Copy Markdown
Contributor

@sagzy sagzy commented May 22, 2026

closes #28063
closes https://linear.app/ghost/issue/ONC-1759

  • Localized the Stripe product title for gift subscription purchases. For example, French sites now show:

Abonnement offert — Pro (1 mois)

instead of:

Gift Subscription - Pro (1 month)

  • Also replaced - by em dash

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 767c0db0-a8f7-47e7-a21e-222ae6c63461

📥 Commits

Reviewing files that changed from the base of the PR and between 5afaea1 and 5ca8add.

📒 Files selected for processing (2)
  • ghost/i18n/locales/context.json
  • ghost/i18n/locales/tr/ghost.json
✅ Files skipped from review due to trivial changes (2)
  • ghost/i18n/locales/context.json
  • ghost/i18n/locales/tr/ghost.json

Walkthrough

The Stripe gift checkout product name and cadence label generation were changed to use the i18n translation helper (t) instead of hardcoded English. Tests were updated to initialize/inject the translation function and to assert translated product names and cadence labels. The new i18n key "Gift subscription" was added across locale JSON files (mostly empty values; French provides "Abonnement offert") and the i18n context description was updated to include Stripe Checkout product title usage.

Possibly related PRs

  • TryGhost/Ghost#27707: Updates French locale entries related to gift subscription strings used by this change.
  • TryGhost/Ghost#27675: Also replaces hardcoded gift/cadence wording with i18n pluralization for cadence labels in a related gift preview area.

Suggested labels

affects:i18n

Suggested reviewers

  • mike182uk
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding translation support for the gift subscription product in Stripe checkout.
Description check ✅ Passed The description is directly related to the changeset, explaining the localization of Stripe product titles and the separator change from dash to em dash.
Linked Issues check ✅ Passed The changes fully address issue #28063 by moving the hardcoded gift subscription product title into the i18n system with proper pluralization and locale-specific formatting.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing i18n translation for the gift subscription Stripe product title as specified in the linked issue.
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
  • Commit unit tests in branch fix/ONC-1759

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.

@sagzy sagzy requested a review from mike182uk May 22, 2026 10:55
Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ghost/core/core/server/services/stripe/stripe-api.js`:
- Around line 706-708: The product title is being built by concatenating
translated fragments and fixed punctuation which prevents locales from
controlling word order; update the code that currently uses name: `${t('Gift
subscription')} — ${tierName} (${cadenceLabel})` to use a single translation key
(via t(...)) that accepts interpolations for tierName and cadenceLabel, e.g.
t('Gift subscription: {tier} ({cadence})', {tier: tierName, cadence:
cadenceLabel}), and ensure cadenceLabel is still computed (cadenceLabel
variable) before calling t so the full title string comes from one localized
key; replace occurrences of the concatenation with this single-key interpolation
approach (refer to cadenceLabel, tierName and the t(...) call in stripe-api.js).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1c8639f-331a-4226-a427-0e62e7b6004d

📥 Commits

Reviewing files that changed from the base of the PR and between fcad5b8 and 5afaea1.

📒 Files selected for processing (65)
  • ghost/core/core/server/services/stripe/stripe-api.js
  • ghost/core/test/unit/server/services/stripe/stripe-api.test.js
  • ghost/i18n/locales/af/ghost.json
  • ghost/i18n/locales/ar/ghost.json
  • ghost/i18n/locales/bg/ghost.json
  • ghost/i18n/locales/bn/ghost.json
  • ghost/i18n/locales/bs/ghost.json
  • ghost/i18n/locales/ca/ghost.json
  • ghost/i18n/locales/context.json
  • ghost/i18n/locales/cs/ghost.json
  • ghost/i18n/locales/da/ghost.json
  • ghost/i18n/locales/de-CH/ghost.json
  • ghost/i18n/locales/de/ghost.json
  • ghost/i18n/locales/el/ghost.json
  • ghost/i18n/locales/en/ghost.json
  • ghost/i18n/locales/eo/ghost.json
  • ghost/i18n/locales/es/ghost.json
  • ghost/i18n/locales/et/ghost.json
  • ghost/i18n/locales/eu/ghost.json
  • ghost/i18n/locales/fa/ghost.json
  • ghost/i18n/locales/fi/ghost.json
  • ghost/i18n/locales/fr/ghost.json
  • ghost/i18n/locales/gd/ghost.json
  • ghost/i18n/locales/he/ghost.json
  • ghost/i18n/locales/hi/ghost.json
  • ghost/i18n/locales/hr/ghost.json
  • ghost/i18n/locales/hu/ghost.json
  • ghost/i18n/locales/id/ghost.json
  • ghost/i18n/locales/is/ghost.json
  • ghost/i18n/locales/it/ghost.json
  • ghost/i18n/locales/ja/ghost.json
  • ghost/i18n/locales/ko/ghost.json
  • ghost/i18n/locales/kz/ghost.json
  • ghost/i18n/locales/lt/ghost.json
  • ghost/i18n/locales/lv/ghost.json
  • ghost/i18n/locales/mk/ghost.json
  • ghost/i18n/locales/mn/ghost.json
  • ghost/i18n/locales/ms/ghost.json
  • ghost/i18n/locales/nb/ghost.json
  • ghost/i18n/locales/ne/ghost.json
  • ghost/i18n/locales/nl/ghost.json
  • ghost/i18n/locales/nn/ghost.json
  • ghost/i18n/locales/pa/ghost.json
  • ghost/i18n/locales/pl/ghost.json
  • ghost/i18n/locales/pt-BR/ghost.json
  • ghost/i18n/locales/pt/ghost.json
  • ghost/i18n/locales/ro/ghost.json
  • ghost/i18n/locales/ru/ghost.json
  • ghost/i18n/locales/si/ghost.json
  • ghost/i18n/locales/sk/ghost.json
  • ghost/i18n/locales/sl/ghost.json
  • ghost/i18n/locales/sq/ghost.json
  • ghost/i18n/locales/sr-Cyrl/ghost.json
  • ghost/i18n/locales/sr/ghost.json
  • ghost/i18n/locales/sv/ghost.json
  • ghost/i18n/locales/sw/ghost.json
  • ghost/i18n/locales/ta/ghost.json
  • ghost/i18n/locales/th/ghost.json
  • ghost/i18n/locales/tr/ghost.json
  • ghost/i18n/locales/uk/ghost.json
  • ghost/i18n/locales/ur/ghost.json
  • ghost/i18n/locales/uz/ghost.json
  • ghost/i18n/locales/vi/ghost.json
  • ghost/i18n/locales/zh-Hant/ghost.json
  • ghost/i18n/locales/zh/ghost.json

Comment thread ghost/core/core/server/services/stripe/stripe-api.js
@mike182uk
Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Co-authored-by: mike182uk <991592+mike182uk@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented May 26, 2026

@copilot resolve the merge conflicts in this pull request

Merged origin/main into this branch and resolved the conflict in ghost/i18n/locales/tr/ghost.json (commit 5ca8add). The conflict was between the new "Gift subscription" key added by this PR and a translation update for "Here's how to keep your {tierName} membership." that landed in main — both changes are now included.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 26, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 5ca8add

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 1m 55s View ↗
nx run @tryghost/admin-x-settings:test:acceptance ✅ Succeeded 9m 5s View ↗
nx run ghost:test:ci:e2e ✅ Succeeded 7m 30s View ↗
nx build @tryghost/portal ✅ Succeeded 1s View ↗
nx build @tryghost/signup-form ✅ Succeeded <1s View ↗
nx build @tryghost/comments-ui ✅ Succeeded <1s View ↗
nx build @tryghost/activitypub ✅ Succeeded 2s View ↗
nx build @tryghost/announcement-bar ✅ Succeeded <1s View ↗
Additional runs (10) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-05-26 16:08:05 UTC

@mike182uk mike182uk merged commit 259e209 into main May 26, 2026
49 checks passed
@mike182uk mike182uk deleted the fix/ONC-1759 branch May 26, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gift subscription Stripe checkout title is hardcoded and not translatable

3 participants