-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(i18n): Add Internationalization Support for UI and LLM Output #1058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📋 Review SummaryThis PR introduces comprehensive internationalization (i18n) support to Qwen Code, allowing users to switch UI languages and configure LLM output languages. The implementation is well-structured with a lightweight translation system, async loading capabilities, and support for custom language packs. The changes span across 64 files, demonstrating the breadth of the i18n integration. 🔍 General Feedback
🎯 Specific Feedback🔴 CriticalNo critical issues identified in this review. 🟡 HighNo high priority issues identified in this review. 🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
tanzhenxin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The packaging issue needs to be addressed, while the other comments kind of subjective.
tanzhenxin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
TLDR
Adds internationalization (i18n) support to Qwen Code. Users can switch UI language (English/Simplified Chinese) and configure LLM output language via a new
/languagecommand. Supports custom language packs via~/.qwen/locales/directory. Includes translation infrastructure and automatic language detection.Dive Deeper
Core Features
UI Language Support
en) and Simplified Chinese (zh)QWEN_CODE_LANGenvironment variablees.js,fr.js) in~/.qwen/locales/New
/languageCommand/language ui [zh-CN|en-US]- Switch UI language/language output <language>- Set LLM output language (creates rule file)Translation Infrastructure
en.js,zh.js){{variable}}syntaxQuality Assurance
check-i18nscript to validate translation filesTechnical Implementation
packages/cli/src/i18n/index.ts): Translation system with async loading, caching, and language detectionpackages/cli/src/ui/commands/languageCommand.ts): Handler for language switchingpackages/cli/src/core/initializer.ts): i18n setup during app startupgeneral.languagesetting (auto,en,zh)packages/cli/src/i18n/locales/Key Design Decisions
~/.qwen/locales/for extensibilityReviewer Test Plan
Testing UI Language Switching
Basic Language Switching
Language Persistence
Auto Detection
QWEN_CODE_LANG=zhand start Qwen CodeCustom Language Pack
~/.qwen/locales/es.js:/language ui esCommand Descriptions
/helpshows descriptions in selected languageTesting LLM Output Language
Set LLM Output Language
Verify Rule File
~/.qwen/output-language.mdcontains language rulesTesting Translation Coverage
Run i18n Check
npm run check-i18n # Verify: All checks pass, no missing translationsTest Edge Cases
Testing Matrix
Linked issues / bugs