Wrapped Podcast strings for translation in Portal#26784
Conversation
WalkthroughThis pull request updates the Transistor podcasts integration in the portal application. The package version is bumped to 2.66.2. The transistor-podcasts-action component modifies its default text: description changes to "Access your RSS feeds" and button text to "Manage". The translation logic is simplified to check if values are default or empty before applying translated defaults. Corresponding unit tests are updated to reflect the new button text. Additionally, two new translation keys—"Access your RSS feeds" and "Podcasts"—are added across all supported locale files with empty translations pending localization. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/portal/src/components/pages/AccountHomePage/components/transistor-podcasts-action.js`:
- Around line 36-40: The isDefault check fails for legacy persisted defaults
causing untranslated old strings to show; update the isDefault logic (used to
compute heading, description, buttonText) to treat legacy default literals as
equivalent to TRANSISTOR_DEFAULTS by checking both TRANSISTOR_DEFAULTS[key] and
the legacy literal values (e.g., 'Access your private podcast feed' for
description and 'View' for button_text) when comparing settings.description and
settings.button_text so existing installations will fall back to t(...) as
intended.
In
`@apps/portal/test/unit/components/pages/AccountHomePage/transistor-podcasts-action.test.js`:
- Around line 20-44: The tests currently assert English text but don't verify
that the component uses i18n; add a new unit test that renders the component
through the same setup helper but with a localized i18n instance (or wrapped
with I18nextProvider) that defines non-English translations for the "Podcasts"
heading and "Manage" label, then assert those translated strings are present
using getByText (e.g., add a test named like 'renders translated strings' that
calls setup({hasPodcasts: true, memberUuid: TEST_UUID}, {i18nResources:
{namespace: {podcastsHeading: "PODCASTS_ES", manageLabel: "MANAGE_ES"}}}) or by
switching i18n.changeLanguage prior to calling setup) to ensure the
TransistorPodcastsAction component actually reads from the translation keys
rather than hardcoded "Podcasts"/"Manage".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 38369da7-a84d-4004-a78c-069b08ff1e16
📒 Files selected for processing (66)
apps/portal/package.jsonapps/portal/src/components/pages/AccountHomePage/components/transistor-podcasts-action.jsapps/portal/test/unit/components/pages/AccountHomePage/transistor-podcasts-action.test.jsghost/i18n/locales/af/portal.jsonghost/i18n/locales/ar/portal.jsonghost/i18n/locales/bg/portal.jsonghost/i18n/locales/bn/portal.jsonghost/i18n/locales/bs/portal.jsonghost/i18n/locales/ca/portal.jsonghost/i18n/locales/context.jsonghost/i18n/locales/cs/portal.jsonghost/i18n/locales/da/portal.jsonghost/i18n/locales/de-CH/portal.jsonghost/i18n/locales/de/portal.jsonghost/i18n/locales/el/portal.jsonghost/i18n/locales/en/portal.jsonghost/i18n/locales/eo/portal.jsonghost/i18n/locales/es/portal.jsonghost/i18n/locales/et/portal.jsonghost/i18n/locales/eu/portal.jsonghost/i18n/locales/fa/portal.jsonghost/i18n/locales/fi/portal.jsonghost/i18n/locales/fr/portal.jsonghost/i18n/locales/gd/portal.jsonghost/i18n/locales/he/portal.jsonghost/i18n/locales/hi/portal.jsonghost/i18n/locales/hr/portal.jsonghost/i18n/locales/hu/portal.jsonghost/i18n/locales/id/portal.jsonghost/i18n/locales/is/portal.jsonghost/i18n/locales/it/portal.jsonghost/i18n/locales/ja/portal.jsonghost/i18n/locales/ko/portal.jsonghost/i18n/locales/kz/portal.jsonghost/i18n/locales/lt/portal.jsonghost/i18n/locales/lv/portal.jsonghost/i18n/locales/mk/portal.jsonghost/i18n/locales/mn/portal.jsonghost/i18n/locales/ms/portal.jsonghost/i18n/locales/nb/portal.jsonghost/i18n/locales/ne/portal.jsonghost/i18n/locales/nl/portal.jsonghost/i18n/locales/nn/portal.jsonghost/i18n/locales/pa/portal.jsonghost/i18n/locales/pl/portal.jsonghost/i18n/locales/pt-BR/portal.jsonghost/i18n/locales/pt/portal.jsonghost/i18n/locales/ro/portal.jsonghost/i18n/locales/ru/portal.jsonghost/i18n/locales/si/portal.jsonghost/i18n/locales/sk/portal.jsonghost/i18n/locales/sl/portal.jsonghost/i18n/locales/sq/portal.jsonghost/i18n/locales/sr-Cyrl/portal.jsonghost/i18n/locales/sr/portal.jsonghost/i18n/locales/sv/portal.jsonghost/i18n/locales/sw/portal.jsonghost/i18n/locales/ta/portal.jsonghost/i18n/locales/th/portal.jsonghost/i18n/locales/tr/portal.jsonghost/i18n/locales/uk/portal.jsonghost/i18n/locales/ur/portal.jsonghost/i18n/locales/uz/portal.jsonghost/i18n/locales/vi/portal.jsonghost/i18n/locales/zh-Hant/portal.jsonghost/i18n/locales/zh/portal.json
ref https://linear.app/ghost/issue/NY-1037/