i18n: backfill update-channel + auto-update keys across 18 languages - #202
Conversation
PR #200 added 18 new locale files, but they predated #199 (auto-update badge + Stable/Preview channel toggle), so they were missing the `update.*` namespace (6 keys) and `about.channel_*` (5 keys) — those strings fell back to English in ar/de/es/fr/hi/id/it/ja/ko/nl/pl/pt/ru/sv/th/tr/uk/vi/zh-TW. Backfill all 11 keys in every one of those languages so the updater UI is fully localized. en.json / zh-CN.json already had them and are untouched. Placeholders ({{version}}, {{pct}}, {{channel}}) preserved verbatim; files re-emitted in the exact format scripts/translate_all.py writes (ensure_ascii=False, indent=2) so the diff is additions only (+13 lines/file, 0 deletions). Also fix scripts/translate_all.py: LOCALES_DIR was hardcoded to a contributor's absolute path (/Users/.../orca/...) — make it repo-relative so the generator actually runs for anyone. Verified: all 21 locales valid JSON + key-complete, placeholders intact; tsc clean; vitest 162/162; build OK; CJK guard passes (locales are the allowlisted translation layer). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThis PR adds localization strings for an update feature across 18 supported languages and corrects the translation script's locale directory path. Each locale file receives identical structural additions for update messaging and channel selection UI, while the translation tooling is fixed to locate these files via relative path. ChangesUpdate Feature Localization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 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 |
|
| Filename | Overview |
|---|---|
| scripts/translate_all.py | Fixed hardcoded absolute LOCALES_DIR to a repo-relative path using os.path.dirname(os.path.abspath(file)); the resulting path contains an unresolved .. component but works correctly at runtime. |
| frontend/src/i18n/locales/tr.json | Adds all 11 required keys; downloading key uses %{{pct}} (percent-before-number) which is linguistically correct for Turkish. |
| frontend/src/i18n/locales/ar.json | Adds all 11 update/channel keys with correct RTL-appropriate Arabic translations and preserved placeholders. |
| frontend/src/i18n/locales/ja.json | Adds all 11 update/channel keys with correct Japanese translations and preserved placeholders. |
| frontend/src/i18n/locales/zh-TW.json | Adds all 11 update/channel keys with correct Traditional Chinese translations; uses full-width dashes consistent with CJK punctuation norms. |
| frontend/src/i18n/locales/de.json | Adds all 11 update/channel keys with correct German translations; uses a space before % in downloading per German typographic conventions. |
| frontend/src/i18n/locales/fr.json | Adds all 11 update/channel keys with correct French translations; uses space before % per French typographic conventions. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["en.json (source of truth)"] --> B["update.* namespace\n6 keys"]
A --> C["about.channel_* keys\n5 keys"]
B --> D["19 locale files\nar, de, es, fr, hi, id, it,\nja, ko, nl, pl, pt, ru, sv,\nth, tr, uk, vi, zh-TW"]
C --> D
D --> E["Updater UI fully localised"]
F["scripts/translate_all.py\nLOCALES_DIR fix"] --> G["Repo-relative path\nvia __file__"]
G --> D
Reviews (1): Last reviewed commit: "i18n: backfill update-channel + auto-upd..." | Re-trigger Greptile
| LOCALES_DIR = os.path.join( | ||
| os.path.dirname(os.path.abspath(__file__)), "..", "frontend", "src", "i18n", "locales" | ||
| ) |
There was a problem hiding this comment.
The
LOCALES_DIR path contains an unresolved .. component. It works at runtime since Python's open() and os.path.exists() handle it, but printing or logging the path for diagnostics would produce something like /repo/scripts/../frontend/src/i18n/locales, which can be confusing. Wrapping with os.path.normpath() produces a clean canonical path at no cost.
| LOCALES_DIR = os.path.join( | |
| os.path.dirname(os.path.abspath(__file__)), "..", "frontend", "src", "i18n", "locales" | |
| ) | |
| LOCALES_DIR = os.path.normpath(os.path.join( | |
| os.path.dirname(os.path.abspath(__file__)), "..", "frontend", "src", "i18n", "locales" | |
| )) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Backfill the update-channel + auto-update keys across the new languages
#200 added 18 translated locale files, but they predated #199 (the auto-update badge + Stable/Preview channel toggle), so they were missing the
update.*namespace (6 keys) andabout.channel_*(5 keys). Those strings were falling back to English in ar, de, es, fr, hi, id, it, ja, ko, nl, pl, pt, ru, sv, th, tr, uk, vi, zh-TW.This fills all 11 keys in every one of those languages, so the updater UI is fully localized.
en.json/zh-CN.jsonuntouched — they already had the keys.{{version}},{{pct}},{{channel}}).scripts/translate_all.pywrites (ensure_ascii=False, indent=2) → diff is additions only (+13 lines/file, 0 deletions).scripts/translate_all.py—LOCALES_DIRwas hardcoded to a contributor's absolute path (/Users/.../orca/...); now repo-relative so the generator actually runs.Verified
All 21 locales valid JSON and key-complete (parity check), placeholders intact;
tscclean; vitest 162/162;bun run build✓; CJK guard passes (locale files are the allowlisted translation layer).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores