feat(cli): full i18n for CLI prompts#109
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Changesinit Command Multilingual Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 `@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
📒 Files selected for processing (3)
bin/comet.jssrc/cli/index.tssrc/commands/init.ts
|
Please resolve the CI issues first. |
What's Changed
Test Plan
已验证:
--language zh显示中文:「正在设置 Comet」「选择要配置的平台」「已存在」「Comet 设置完成!」等--language en显示英文:「Setting up Comet」「Select platforms to set up」「already exists」「Comet setup complete!」等Screenshots
Chinese (
--language zh)English (
--language en)Summary by CodeRabbit
Release Notes
--language <lang>option to the initialization command (supports English and Chinese).