Skip to content

🌐 Added missed string wrapping for Portal's offer page#26884

Merged
9larsons merged 4 commits intoTryGhost:mainfrom
cathysarisky:i18n-wrapping-offers
Mar 19, 2026
Merged

🌐 Added missed string wrapping for Portal's offer page#26884
9larsons merged 4 commits intoTryGhost:mainfrom
cathysarisky:i18n-wrapping-offers

Conversation

@cathysarisky
Copy link
Member

@cathysarisky cathysarisky commented Mar 19, 2026

no ref

  • Abstracted the translateCadence function to utils since we need it in multiple places.
  • Fixed two more places cadence wasn't wrapped for translations.
  • Removed "{amountOff} off" string, since we are already using "{amount} off" elsewhere.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

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: 2da700f4-629f-46cb-8e02-ccb9ff38eb37

📥 Commits

Reviewing files that changed from the base of the PR and between 62a0a2b and e376768.

📒 Files selected for processing (1)
  • apps/portal/package.json
✅ Files skipped from review due to trivial changes (1)
  • apps/portal/package.json

Walkthrough

Added a new exported helper translateCadence(cadence) in apps/portal/src/utils/helpers.js that maps 'month' and 'year' to localized strings. Imported and used this helper in account-plan-page.js and offer-page.js, removing a local cadence translation function from account-plan-page.js. Updated retention-offer label formatting to use the {amount} interpolation token. Many locale JSON files had the "{amountOff} off" translation entries removed. Package version for @tryghost/portal was bumped from 2.66.7 to 2.66.8.

Possibly related PRs

  • TryGhost/Ghost PR 26882: Modifies cadence localization and introduces/uses the translateCadence helper.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main change: adding internationalization (i18n) string wrapping for the Portal's offer page, which is the core objective.
Description check ✅ Passed The PR description directly relates to the changeset by explaining the three main modifications: abstracting translateCadence, fixing cadence translations, and removing redundant string keys.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

return diffHours < 24;
}

// Translate cadence to human readable string
Copy link
Contributor

Choose a reason for hiding this comment

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

What an ugly file this is. 1000 lines of 'helpers' 😁.

Copy link
Member Author

Choose a reason for hiding this comment

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

Problem for another day!!

@9larsons 9larsons merged commit 742746c into TryGhost:main Mar 19, 2026
34 checks passed
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