Skip to content

i18n: backfill update-channel + auto-update keys across 18 languages - #202

Merged
debpalash merged 1 commit into
mainfrom
chore/i18n-backfill-update-keys
May 31, 2026
Merged

i18n: backfill update-channel + auto-update keys across 18 languages#202
debpalash merged 1 commit into
mainfrom
chore/i18n-backfill-update-keys

Conversation

@debpalash

@debpalash debpalash commented May 31, 2026

Copy link
Copy Markdown
Owner

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) and about.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.json untouched — they already had the keys.
  • Placeholders preserved verbatim ({{version}}, {{pct}}, {{channel}}).
  • Files re-emitted in the exact format scripts/translate_all.py writes (ensure_ascii=False, indent=2) → diff is additions only (+13 lines/file, 0 deletions).
  • Bonus: fixed scripts/translate_all.pyLOCALES_DIR was 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; tsc clean; 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

    • Added multi-language localization strings for update notifications, including availability alerts, installation prompts, download progress, and restart messages.
    • Added multi-language support for update channel selection (stable vs. preview) with descriptive guidance.
  • Chores

    • Improved script path handling for better cross-platform compatibility.

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>
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5a1bf7c8-1275-4d46-923e-08d9c4ec5744

📥 Commits

Reviewing files that changed from the base of the PR and between 52d7321 and 8e09746.

📒 Files selected for processing (20)
  • frontend/src/i18n/locales/ar.json
  • frontend/src/i18n/locales/de.json
  • frontend/src/i18n/locales/es.json
  • frontend/src/i18n/locales/fr.json
  • frontend/src/i18n/locales/hi.json
  • frontend/src/i18n/locales/id.json
  • frontend/src/i18n/locales/it.json
  • frontend/src/i18n/locales/ja.json
  • frontend/src/i18n/locales/ko.json
  • frontend/src/i18n/locales/nl.json
  • frontend/src/i18n/locales/pl.json
  • frontend/src/i18n/locales/pt.json
  • frontend/src/i18n/locales/ru.json
  • frontend/src/i18n/locales/sv.json
  • frontend/src/i18n/locales/th.json
  • frontend/src/i18n/locales/tr.json
  • frontend/src/i18n/locales/uk.json
  • frontend/src/i18n/locales/vi.json
  • frontend/src/i18n/locales/zh-TW.json
  • scripts/translate_all.py

📝 Walkthrough

Walkthrough

This 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.

Changes

Update Feature Localization

Layer / File(s) Summary
Update UI and channel selection strings across all locales
frontend/src/i18n/locales/ar.json, de.json, es.json, fr.json, hi.json, id.json, it.json, ja.json, ko.json, nl.json, pl.json, pt.json, ru.json, sv.json, th.json, tr.json, uk.json, vi.json, zh-TW.json
Each of 18 locale files gains a top-level update object with 6 UI strings (available, install, install_hint, downloading, restart, busy) and about section entries for update-channel configuration (update_channel, channel_stable, channel_preview, channel_set, channel_preview_hint), enabling multilingual support for update workflows and release-channel selection.
Translation script locale directory path resolution
scripts/translate_all.py
The LOCALES_DIR path is computed relative to the script's filesystem location using __file__ instead of a hardcoded absolute path, enabling the translation tool to reliably locate and process locale files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a thorough explanation of the problem, solution, and verification steps. However, it lacks the required 'Type' checkbox selection and 'Testing' details as specified in the template. Add the 'Type' section with an appropriate checkbox selection (e.g., '✨ New feature') and expand the 'Testing' section with specific test results or steps taken to verify the changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'i18n: backfill update-channel + auto-update keys across 18 languages' clearly and specifically describes the main change: adding missing localization keys to 18 language files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/i18n-backfill-update-keys

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.

@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR backfills 11 missing i18n keys (update.* and about.channel_*) across 19 locale files that were added in #200 before the auto-update UI landed in #199, and fixes a broken LOCALES_DIR absolute path in scripts/translate_all.py so the translation generator is actually runnable from any checkout.

  • Each of the 19 affected locales receives 6 update.* keys (badge + download progress + restart prompt) and 5 about.channel_* keys (channel toggle labels + hint), with all {{version}}, {{pct}}, and {{channel}} placeholders preserved verbatim. Locale-specific formatting conventions are respected (e.g. %{{pct}} in Turkish, non-breaking space before % in French and German, full-width dashes in Traditional Chinese).
  • scripts/translate_all.py had LOCALES_DIR hardcoded to a contributor's machine path (/Users/user4/orca/...); it is now computed at runtime relative to the script file, making the generator usable without manual edits.

Confidence Score: 4/5

Safe to merge — changes are pure translation additions with no logic changes, and the translate_all.py fix is correct and tested.

All 19 locale files receive addition-only patches with the correct 11 keys and preserved placeholders. The translate_all.py LOCALES_DIR fix uses an unresolved .. component in the path but resolves correctly at runtime; wrapping it with os.path.normpath() would make it cleaner but is not blocking.

No files require special attention; the only note is the minor path construction in scripts/translate_all.py.

Important Files Changed

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
Loading

Fix All in Claude Code

Reviews (1): Last reviewed commit: "i18n: backfill update-channel + auto-upd..." | Re-trigger Greptile

Comment thread scripts/translate_all.py
Comment on lines +7 to +9
LOCALES_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", "frontend", "src", "i18n", "locales"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 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.

Suggested change
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!

Fix in Claude Code

@debpalash
debpalash merged commit 87e4df9 into main May 31, 2026
15 checks passed
@debpalash
debpalash deleted the chore/i18n-backfill-update-keys branch May 31, 2026 05:51
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.

1 participant