Added Turkish translation for gift subscription#28904
Conversation
WalkthroughUpdated Turkish locale strings in 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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: 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/i18n/locales/tr/portal.json`:
- Line 200: The translation for the key in portal.json drops the required
{siteTitle} placeholder, breaking the message contract used at runtime. Update
the localized string in the Turkish locale entry for this message so it
preserves the same {siteTitle} interpolation as the source text, and verify the
placeholder remains unchanged in the translation.
🪄 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: cbed1377-e0bf-43ff-afdd-405e39b1d9b1
📒 Files selected for processing (2)
ghost/i18n/locales/tr/ghost.jsonghost/i18n/locales/tr/portal.json
| "Sending...": "Gönderiliyor...", | ||
| "Share": "Paylaş", | ||
| "Share a full membership to {siteTitle} with a friend or colleague": "Bir arkadaşınız veya iş arkadaşınızla {siteTitle} tam üyeliğini paylaşın.", | ||
| "Share a full membership to {siteTitle} with a friend or colleague": "Yakınlarınız için en havalı hediye, hem de mağaza gezme derdi olmadan.", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Preserve {siteTitle} interpolation in this translation.
Line 200 drops {siteTitle}, but this key is rendered with {siteTitle} at runtime, so the localized string no longer matches the source message contract.
Suggested fix
- "Share a full membership to {siteTitle} with a friend or colleague": "Yakınlarınız için en havalı hediye, hem de mağaza gezme derdi olmadan.",
+ "Share a full membership to {siteTitle} with a friend or colleague": "{siteTitle} için tam üyeliği bir arkadaşınızla veya iş arkadaşınızla paylaşın.",📝 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.
| "Share a full membership to {siteTitle} with a friend or colleague": "Yakınlarınız için en havalı hediye, hem de mağaza gezme derdi olmadan.", | |
| "Share a full membership to {siteTitle} with a friend or colleague": "{siteTitle} için tam üyeliği bir arkadaşınızla veya iş arkadaşınızla paylaşın.", |
🤖 Prompt for 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.
In `@ghost/i18n/locales/tr/portal.json` at line 200, The translation for the key
in portal.json drops the required {siteTitle} placeholder, breaking the message
contract used at runtime. Update the localized string in the Turkish locale
entry for this message so it preserves the same {siteTitle} interpolation as the
source text, and verify the placeholder remains unchanged in the translation.
There was a problem hiding this comment.
@selin-blip Why don't we need {siteTitle} here?
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
key='Share a full membership to {siteTitle} with a friend or colleague'
echo "== Find exact key usage =="
rg -n -F "$key" .
echo
echo "== Outline likely portal i18n/usage files =="
fd -a 'gift|portal|i18n|translation|locale' apps ghost --max-depth 6 2>/dev/null | sed -n '1,200p'
echo
echo "== Search for siteTitle interpolation near gift/share UI =="
rg -n -C3 --glob '!ghost/i18n/locales/**' 'siteTitle|Gift a membership|friend or colleague|gift' apps ghostLength of output: 243478
🏁 Script executed:
#!/bin/bash
set -euo pipefail
key='Share a full membership to {siteTitle} with a friend or colleague'
echo "== Exact matches for the key across the repo =="
rg -n -C2 -F "$key" .
echo
echo "== Narrow search for the gift purchase success/share UI in portal source =="
rg -n -C3 --glob '!ghost/i18n/locales/**' --glob '!**/test/**' \
'Share a full membership|Send the link below to share it|siteTitle|gift-purchase-success|gift_token' \
apps ghostLength of output: 255827
@9larsons We do need {siteTitle} here.
I checked the runtime usage:
apps/portal/src/components/pages/gift-page.jsLine 847 calls
t('Share a full membership to {siteTitle} with a friend or colleague', {siteTitle})ghost/i18n/locales/context.jsonLine 278 also documents this key and says{siteTitle}is the publication name.
So once Turkish provides a non-empty translation for that key, it should preserve the same placeholder contract. Dropping {siteTitle} won’t crash, but it does discard runtime data that the source string expects to show.
In other words:
- empty translation → falls back to English, fine
- translated value without
{siteTitle}→ loses the publication name, so the review comment still applies
🐇💭
🧠 Learnings used
Learnt from: cathysarisky
Repo: TryGhost/Ghost PR: 27188
File: ghost/i18n/locales/ar/portal.json:15-15
Timestamp: 2026-04-06T20:50:45.744Z
Learning: In TryGhost/Ghost, follow the i18n workflow for locale files: when introducing new i18n keys, allow a first PR to ship the feature while adding the new keys with empty/blank string values in the locale JSON files (e.g., under ghost/i18n/locales/...). In code review, do not flag empty string values in these locale JSON files as missing translations; expect the actual translated text to be provided in a subsequent follow-up PR.
Learnt from: sagzy
Repo: TryGhost/Ghost PR: 27840
File: ghost/core/core/server/services/gifts/gift-email-service.ts:75-80
Timestamp: 2026-05-13T11:28:15.780Z
Learning: In the TryGhost/Ghost monorepo’s `ghost/i18n` code/locales (using i18next v23.x), do not raise code review findings for “missing pluralization configuration.” i18next v23 automatically handles pluralization via the Intl API, so you should not expect/require an explicit `pluralSeparator` or manual pluralization rules. Locale JSON plural keys should use the `_one`/`_other` suffix convention (e.g., `"{count} year_one"` / `"{count} year_other"`), and calls like `t("{count} year", { count: n })` should be considered correct and should resolve plural forms.
| "Sending...": "Gönderiliyor...", | ||
| "Share": "Paylaş", | ||
| "Share a full membership to {siteTitle} with a friend or colleague": "Bir arkadaşınız veya iş arkadaşınızla {siteTitle} tam üyeliğini paylaşın.", | ||
| "Share a full membership to {siteTitle} with a friend or colleague": "Yakınlarınız için en havalı hediye, hem de mağaza gezme derdi olmadan.", |
There was a problem hiding this comment.
@selin-blip Why don't we need {siteTitle} here?
I have added a Turkish translation for Ghost's new gift subscription feature.