🌐 Combined portal subscribe notification translation key#27203
🌐 Combined portal subscribe notification translation key#27203
Conversation
WalkthroughThis pull request updates the portal package version from 2.67.10 to 2.67.11 and modifies how subscription success notifications display the site title. The notification component now imports and uses the 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
The old pattern split the sentence "You've successfully subscribed to" into a fragment key with the site title appended outside the translated string. This meant translators couldn't reorder words around the site title. The new key uses @doist/react-interpolate to embed <strong> within a single translatable string, preserving existing translations.
cacd8e3 to
698bccb
Compare
|
cathysarisky
left a comment
There was a problem hiding this comment.
LGTM! Thanks for making things better for our non-English sites! :)
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (1)
apps/portal/src/components/notification.js (1)
47-68: Consider collapsing duplicated success branches forsignupandsignup-paid.Both branches render identical JSX and can be merged into one condition to reduce maintenance overhead.
♻️ Proposed refactor
- } else if (type === 'signup' && status === 'success') { - return ( - <p> - <Interpolate - mapping={{ - strong: <strong /> - }} - string={t('You\'ve successfully subscribed to <strong>{siteTitle}</strong>', {siteTitle: context.site.title})} - /> - </p> - ); - } else if (type === 'signup-paid' && status === 'success') { + } else if ((type === 'signup' || type === 'signup-paid') && status === 'success') { return ( <p> <Interpolate mapping={{ strong: <strong /> }} string={t('You\'ve successfully subscribed to <strong>{siteTitle}</strong>', {siteTitle: context.site.title})} /> </p> );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/portal/src/components/notification.js` around lines 47 - 68, The two identical success branches that check type === 'signup' and type === 'signup-paid' should be collapsed into a single condition to avoid duplication: replace the separate else if (type === 'signup' && status === 'success') and else if (type === 'signup-paid' && status === 'success') blocks with one condition that matches both types (e.g., (type === 'signup' || type === 'signup-paid') && status === 'success') and return the shared JSX (the <p> with <Interpolate> using context.site.title and mapping strong) from that single branch; update any surrounding control flow in the render function/component (notification rendering logic) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ghost/i18n/locales/de/portal.json`:
- Line 245: The German translation for the key "You've successfully subscribed
to <strong>{siteTitle}</strong>" uses "angemeldet" (which implies sign-in) and
should be replaced with a subscription verb; update the value string in
portal.json so it reads e.g. "Du hast <strong>{siteTitle}</strong> erfolgreich
abonniert" (or similar using "abonniert") to accurately reflect the subscribe
action for the key "You've successfully subscribed to
<strong>{siteTitle}</strong>".
In `@ghost/i18n/locales/hu/portal.json`:
- Line 245: Update the value for the key "You've successfully subscribed to
<strong>{siteTitle}</strong>" to use the correct Hungarian verb for "subscribed"
and remove the extra space before <strong>; e.g. replace "Sikeresen
bejelentkeztél ide: <strong>{siteTitle}</strong>" with a correct translation
such as "Sikeresen feliratkoztál erre: <strong>{siteTitle}</strong>" so the
message reflects subscription, not sign-in.
In `@ghost/i18n/locales/ja/portal.json`:
- Line 245: The Japanese translation for the key "You've successfully subscribed
to <strong>{siteTitle}</strong>" has the {siteTitle} placed after the particle
phrase, producing unnatural word order; update the value so the site title
appears before the particle phrase (e.g., place <strong>{siteTitle}</strong>
immediately before "の購読に成功しました") to restore natural Japanese word order in the
portal.json entry.
In `@ghost/i18n/locales/mn/portal.json`:
- Line 245: Update the Mongolian translation for the key "You've successfully
subscribed to <strong>{siteTitle}</strong>" so the {siteTitle} placeholder is
integrated into a single natural sentence instead of appearing as an orphan
fragment; replace the current value "Таны захиалга амжилттай үүслээ.
<strong>{siteTitle}</strong>" with a grammatically connected phrase such as "Та
<strong>{siteTitle}</strong>-д амжилттай захиалсан байна" (or an equivalent
natural Mongolian sentence) so the site title is part of the sentence.
In `@ghost/i18n/locales/pt-BR/portal.json`:
- Line 245: The Portuguese translation for the key "You've successfully
subscribed to <strong>{siteTitle}</strong>" in portal.json is missing the
required preposition before the site title; update the value to include "em" or
the correct contraction (e.g., "em <strong>{siteTitle}</strong>" or "no
<strong>{siteTitle}</strong>" / "na <strong>{siteTitle}</strong>") so the string
becomes grammatically correct (e.g., "Você se inscreveu com sucesso em
<strong>{siteTitle}</strong>").
In `@ghost/i18n/locales/si/portal.json`:
- Line 245: The Sinhala string for the key "You've successfully subscribed to
<strong>{siteTitle}</strong>" is missing a grammatical connector to link the
site title; update the translation to include the appropriate Sinhala
postposition (e.g., "ට") or rephrase so the placeholder integrates properly (for
example include "ට" after the site title or use "ඔබ <strong>{siteTitle}</strong>
ට සාර්ථකව සබ්ස්ක්රයිබ් වී ඇත") so the sentence reads naturally.
---
Nitpick comments:
In `@apps/portal/src/components/notification.js`:
- Around line 47-68: The two identical success branches that check type ===
'signup' and type === 'signup-paid' should be collapsed into a single condition
to avoid duplication: replace the separate else if (type === 'signup' && status
=== 'success') and else if (type === 'signup-paid' && status === 'success')
blocks with one condition that matches both types (e.g., (type === 'signup' ||
type === 'signup-paid') && status === 'success') and return the shared JSX (the
<p> with <Interpolate> using context.site.title and mapping strong) from that
single branch; update any surrounding control flow in the render
function/component (notification rendering logic) accordingly.
🪄 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: f52decc2-72c3-4bdc-b2d1-e51fbcb184c0
📒 Files selected for processing (65)
apps/portal/package.jsonapps/portal/src/components/notification.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
| "You're not receiving emails because you either marked a recent message as spam, or because messages could not be delivered to your provided email address.": "Du erhältst keine E-Mails, da du entweder eine kürzlich empfangene Nachricht als Spam markiert hast oder weil Nachrichten nicht an deine angegebene E-Mail-Adresse zugestellt werden konnten.", | ||
| "You've successfully signed in.": "Du hast dich erfolgreich angemeldet.", | ||
| "You've successfully subscribed to": "Du hast dich erfolgreich angemeldet bei", | ||
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Du hast dich erfolgreich angemeldet bei <strong>{siteTitle}</strong>", |
There was a problem hiding this comment.
Translation meaning drift: “angemeldet” maps to sign-in, not subscribe.
Line 245 currently reads like a login confirmation. For this key, use a subscription verb (abonniert) to match the UI action.
Suggested wording fix
- "You've successfully subscribed to <strong>{siteTitle}</strong>": "Du hast dich erfolgreich angemeldet bei <strong>{siteTitle}</strong>",
+ "You've successfully subscribed to <strong>{siteTitle}</strong>": "Du hast <strong>{siteTitle}</strong> erfolgreich abonniert.",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Du hast dich erfolgreich angemeldet bei <strong>{siteTitle}</strong>", | |
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Du hast <strong>{siteTitle}</strong> erfolgreich abonniert.", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/i18n/locales/de/portal.json` at line 245, The German translation for
the key "You've successfully subscribed to <strong>{siteTitle}</strong>" uses
"angemeldet" (which implies sign-in) and should be replaced with a subscription
verb; update the value string in portal.json so it reads e.g. "Du hast
<strong>{siteTitle}</strong> erfolgreich abonniert" (or similar using
"abonniert") to accurately reflect the subscribe action for the key "You've
successfully subscribed to <strong>{siteTitle}</strong>".
| "You're not receiving emails because you either marked a recent message as spam, or because messages could not be delivered to your provided email address.": "Nem kapsz e-maileket, mert vagy spamnek jelöltél egy tőlünk kapott e-mailt, vagy mert a megadott e-mail-cím nem tud üzeneteket fogadni.", | ||
| "You've successfully signed in.": "Sikeresen bejelentkeztél.", | ||
| "You've successfully subscribed to": "Sikeresen bejelentkeztél ide: ", | ||
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Sikeresen bejelentkeztél ide: <strong>{siteTitle}</strong>", |
There was a problem hiding this comment.
Hungarian text uses “signed in” instead of “subscribed.”
Line 245 currently translates the subscribe success message as login success (bejelentkeztél), which is the wrong action in this context. There’s also an extra space before <strong>.
💡 Suggested correction
- "You've successfully subscribed to <strong>{siteTitle}</strong>": "Sikeresen bejelentkeztél ide: <strong>{siteTitle}</strong>",
+ "You've successfully subscribed to <strong>{siteTitle}</strong>": "Sikeresen feliratkoztál ide: <strong>{siteTitle}</strong>",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Sikeresen bejelentkeztél ide: <strong>{siteTitle}</strong>", | |
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Sikeresen feliratkoztál ide: <strong>{siteTitle}</strong>", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/i18n/locales/hu/portal.json` at line 245, Update the value for the key
"You've successfully subscribed to <strong>{siteTitle}</strong>" to use the
correct Hungarian verb for "subscribed" and remove the extra space before
<strong>; e.g. replace "Sikeresen bejelentkeztél ide:
<strong>{siteTitle}</strong>" with a correct translation such as "Sikeresen
feliratkoztál erre: <strong>{siteTitle}</strong>" so the message reflects
subscription, not sign-in.
| "You're not receiving emails because you either marked a recent message as spam, or because messages could not be delivered to your provided email address.": "最近のメッセージをスパムとして判定したか、提供されたメールアドレスに配信できなかったため、メールを受信していません。", | ||
| "You've successfully signed in.": "ログインに成功しました", | ||
| "You've successfully subscribed to": "の購読に成功しました", | ||
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "の購読に成功しました <strong>{siteTitle}</strong>", |
There was a problem hiding this comment.
Japanese word order is inverted in the new combined string.
Current text places {siteTitle} after の購読に成功しました, which produces unnatural/broken output. Move {siteTitle} before the particle phrase.
✏️ Proposed fix
- "You've successfully subscribed to <strong>{siteTitle}</strong>": "の購読に成功しました <strong>{siteTitle}</strong>",
+ "You've successfully subscribed to <strong>{siteTitle}</strong>": "<strong>{siteTitle}</strong>の購読に成功しました",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/i18n/locales/ja/portal.json` at line 245, The Japanese translation for
the key "You've successfully subscribed to <strong>{siteTitle}</strong>" has the
{siteTitle} placed after the particle phrase, producing unnatural word order;
update the value so the site title appears before the particle phrase (e.g.,
place <strong>{siteTitle}</strong> immediately before "の購読に成功しました") to restore
natural Japanese word order in the portal.json entry.
| "You're not receiving emails because you either marked a recent message as spam, or because messages could not be delivered to your provided email address.": "Таны имэйл хүлээж авахгүй байгаа шалтгаан нь нэг бол та аль нэг имэйлийг спам гэж тэмдэглэсэн, эсвэл таны хаяг имэйл хүлээж авах боломжгүй байна.", | ||
| "You've successfully signed in.": "Та амжилттай нэвтэрлээ.", | ||
| "You've successfully subscribed to": "Таны захиалга амжилттай үүслээ.", | ||
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Таны захиалга амжилттай үүслээ. <strong>{siteTitle}</strong>", |
There was a problem hiding this comment.
Mongolian translation has disconnected site title.
The site title placeholder appears after a sentence-ending period, making it grammatically disconnected. The current text reads "Your subscription was successfully created. {siteTitle}" where the site title is an orphan fragment.
Consider restructuring to integrate the site title into the sentence, e.g., "Та {siteTitle}-д амжилттай захиалга хийлээ" or similar phrasing that naturally incorporates the site title.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/i18n/locales/mn/portal.json` at line 245, Update the Mongolian
translation for the key "You've successfully subscribed to
<strong>{siteTitle}</strong>" so the {siteTitle} placeholder is integrated into
a single natural sentence instead of appearing as an orphan fragment; replace
the current value "Таны захиалга амжилттай үүслээ. <strong>{siteTitle}</strong>"
with a grammatically connected phrase such as "Та <strong>{siteTitle}</strong>-д
амжилттай захиалсан байна" (or an equivalent natural Mongolian sentence) so the
site title is part of the sentence.
| "You're not receiving emails because you either marked a recent message as spam, or because messages could not be delivered to your provided email address.": "Você não está recebendo e-mails porque classificou uma mensagem recente como spam ou porque as mensagens não puderam ser entregues no endereço de e-mail que você forneceu.", | ||
| "You've successfully signed in.": "Você entrou com sucesso.", | ||
| "You've successfully subscribed to": "Você se inscreveu com sucesso", | ||
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Você se inscreveu com sucesso <strong>{siteTitle}</strong>", |
There was a problem hiding this comment.
Portuguese translation missing preposition before site title.
The translation appears grammatically incomplete. In Portuguese, "subscribed to X" typically requires a preposition. Consider adding "em" or an article contraction:
Suggested fix
- "You've successfully subscribed to <strong>{siteTitle}</strong>": "Você se inscreveu com sucesso <strong>{siteTitle}</strong>",
+ "You've successfully subscribed to <strong>{siteTitle}</strong>": "Você se inscreveu com sucesso em <strong>{siteTitle}</strong>",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Você se inscreveu com sucesso <strong>{siteTitle}</strong>", | |
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "Você se inscreveu com sucesso em <strong>{siteTitle}</strong>", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/i18n/locales/pt-BR/portal.json` at line 245, The Portuguese translation
for the key "You've successfully subscribed to <strong>{siteTitle}</strong>" in
portal.json is missing the required preposition before the site title; update
the value to include "em" or the correct contraction (e.g., "em
<strong>{siteTitle}</strong>" or "no <strong>{siteTitle}</strong>" / "na
<strong>{siteTitle}</strong>") so the string becomes grammatically correct
(e.g., "Você se inscreveu com sucesso em <strong>{siteTitle}</strong>").
| "You're not receiving emails because you either marked a recent message as spam, or because messages could not be delivered to your provided email address.": "මෑතකදී ලැබුණු email පණිවිඩයක් spam ලෙස සටහන් කිරීම නිසා හෝ ඔබ ලබාදී ඇති email ලිපිනයට email පණිවිඩ යැවිය නොහැකි නිසාවෙන් ඔබට email ලැබෙන්නේ නැත.", | ||
| "You've successfully signed in.": "ඔබ සාර්ථකව sign in වන ලදී.", | ||
| "You've successfully subscribed to": "ඔබ සාර්ථකව subscribe ක\u200bර ඇත", | ||
| "You've successfully subscribed to <strong>{siteTitle}</strong>": "ඔබ සාර්ථකව subscribe ක\u200bර ඇත <strong>{siteTitle}</strong>", |
There was a problem hiding this comment.
Sinhala translation may need grammatical connector for site title.
The site title placeholder appears appended without a clear grammatical connection to the preceding text. The translation reads approximately "You have successfully subscribed {siteTitle}" without the equivalent of "to" connecting them.
Consider adding the appropriate Sinhala postposition or case marker to properly integrate the site title into the sentence.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/i18n/locales/si/portal.json` at line 245, The Sinhala string for the
key "You've successfully subscribed to <strong>{siteTitle}</strong>" is missing
a grammatical connector to link the site title; update the translation to
include the appropriate Sinhala postposition (e.g., "ට") or rephrase so the
placeholder integrates properly (for example include "ට" after the site title or
use "ඔබ <strong>{siteTitle}</strong> ට සාර්ථකව සබ්ස්ක්රයිබ් වී ඇත") so the
sentence reads naturally.
|
@cathysarisky Thanks for the approval, I'm going to merge. CodeRabbit highlighted some issues in the translations, but none were introduced in this PR, they just become evident thanks to the string now being combined correctly, which is exactly what we want to see. I won't fix the translations here because I'm not a native speaker and I can't verify any of the AI output, but hopefully spotting and fixing these grammatical issues will be easier now thanks to the interpolation. |
Agreed! Code Rabbit is just giving you some good justification for why this is the right thing to do! :) Translators can take it from here. |



The Portal subscribe success notification previously split its message across two translation keys and a hardcoded
<strong>tag —t("You've successfully subscribed to")followed by a raw<strong>{context.site.title}</strong>. This made it impossible for translators to reorder the site title within the sentence, which is necessary for many languages where the grammar requires the site name to appear in a different position.This change combines the phrase and the site title into a single translation key:
"You've successfully subscribed to <strong>{siteTitle}</strong>". The@doist/react-interpolatelibrary (already used elsewhere in Portal) handles rendering the<strong>tag from the translated string. All 60+ locale files have been updated to use the new key format, preserving existing translations while embedding the<strong>{siteTitle}</strong>placeholder in each.This follows the same pattern established in #27174 for the commenting-disabled translation keys.