Skip to content

feat(cli): full i18n for CLI prompts#109

Open
21307369 wants to merge 3 commits into
rpamis:masterfrom
21307369:feat-i18n-rpamis
Open

feat(cli): full i18n for CLI prompts#109
21307369 wants to merge 3 commits into
rpamis:masterfrom
21307369:feat-i18n-rpamis

Conversation

@21307369

@21307369 21307369 commented Jun 14, 2026

Copy link
Copy Markdown

What's Changed

  • 新增 CLI 交互提示的完整国际化支持
  • 语言选择提前到第一个 prompt,后续所有提示都跟随所选语言
  • 翻译覆盖:安装范围、平台选择、覆盖确认、安装进度消息、最终摘要
  • 支持中文和英文两种语言

Test Plan

# 中文界面
comet init --language zh

# 英文界面
comet init --language en

已验证:

  • --language zh 显示中文:「正在设置 Comet」「选择要配置的平台」「已存在」「Comet 设置完成!」等
  • --language en 显示英文:「Setting up Comet」「Select platforms to set up」「already exists」「Comet setup complete!」等

Screenshots

Chinese (--language zh)

正在设置 Comet:/path/to/project
安装范围:
  项目(当前目录)
  全局(主目录)
选择要配置的平台:
  Claude Code (已检测到)
  Pi (已检测到)

English (--language en)

Setting up Comet in /path/to/project
Install scope:
  Project (current directory)
  Global (home directory)
Select platforms to set up:
  Claude Code (detected)
  Pi (detected)

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a --language <lang> option to the initialization command (supports English and Chinese).
    • Implemented multilingual CLI prompts and localized setup summary output.
    • Language selection now happens at the start of the setup flow, driving all subsequent messages.
    • Localized platform/scope prompts, installation logs, and “get started” section labels.

lsmir3 added 2 commits June 14, 2026 23:06
Add --language CLI option (en/zh) to comet init command,
allowing users to specify skill language directly without interactive selection.
- Add translation dictionary for all CLI interaction strings
- Move language selection to first prompt so all subsequent prompts can be localized
- Translate: scope, platforms, overwrite choices, installation messages, summary
- Support both English and Chinese for all user-facing prompts
- Test verified: --language zh shows Chinese, --language en shows English
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b735276d-b1a3-464e-a187-9d1a20fca7d8

📥 Commits

Reviewing files that changed from the base of the PR and between e461e45 and 77ab652.

📒 Files selected for processing (1)
  • src/commands/init.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/commands/init.ts

📝 Walkthrough

Walkthrough

The init command gains multilingual support for English and Chinese. A TranslationKey union, TRANSLATIONS dictionary, and t(lang, key) helper are added to src/commands/init.ts. InitOptions gains an optional language field, a --language <lang> CLI option is wired in src/cli/index.ts, and all prompts, installation logs, and summary output are localized through the selected language.

Changes

init Command Multilingual Support

Layer / File(s) Summary
i18n infrastructure, InitOptions.language, and CLI flag
src/cli/index.ts, src/commands/init.ts
Adds TranslationKey union, TRANSLATIONS object for en/zh, t(lang, key) helper with English fallback, language field on InitOptions, and --language <lang> CLI option constrained to ['en', 'zh'].
Language/scope/platform selection and overwrite prompt localization
src/commands/init.ts
Refactors selectScope, selectLanguage, and selectPlatforms to accept and use lang for localized prompt text; updates promptOverwriteChoice and promptBulkOverwriteChoice to build message strings from translation keys while preserving return type unions.
initCommand control flow and installation phase localization
src/commands/init.ts
Reorders initCommand to select language/lang first, then localizes setup, version, no-platforms, bulk/per-component overwrite, OpenSpec/Superpowers installing/skipped, Comet skipped/rules/hooks, and CodeGraph prompt/log output via t(lang, ...). Action-resolution logic documented.
displaySummary localization
src/commands/init.ts
Updates displaySummary to accept lang and localizes setup-complete heading, installed/skipped/failed labels, working-directories section, and get-started labels. Call site updated to pass lang.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 Hop hop, the rabbit speaks two tongues today,
English or Chinese — just pick your way!
--language zh and the prompts bloom bright,
t(lang, key) translates each message right.
From init to summary, no word left behind —
A bilingual burrow for all humankind! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cli): full i18n for CLI prompts' clearly and concisely describes the main change—adding full internationalization support to CLI prompts, which matches the comprehensive translation coverage implemented in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 `@src/commands/init.ts`:
- Line 278: The init command has hardcoded English strings that bypass the
localization function in user-facing output at multiple locations. In
src/commands/init.ts at line 278, replace the hardcoded English string `scope`
in the console.log with a localized version using the t() function (e.g.,
t(lang, 'scope')). Similarly, at lines 461 and 516, identify and replace any
hardcoded English literals like `skipped` with their corresponding localized
equivalents using the translation function t(lang, key) to ensure the entire
init flow is properly translated when lang is set to values other than English.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5296bb0d-2176-49f4-ad2c-b7df4c91ffb0

📥 Commits

Reviewing files that changed from the base of the PR and between 1148910 and e461e45.

📒 Files selected for processing (3)
  • bin/comet.js
  • src/cli/index.ts
  • src/commands/init.ts

Comment thread src/commands/init.ts
@21307369 21307369 closed this Jun 14, 2026
@21307369 21307369 deleted the feat-i18n-rpamis branch June 14, 2026 15:16
@21307369 21307369 restored the feat-i18n-rpamis branch June 14, 2026 15:32
@21307369 21307369 reopened this Jun 14, 2026
@benym

benym commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Please resolve the CI issues first.

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.

3 participants