feat: add i18n support for Chinese and English CLI#1
Open
ironfrancis wants to merge 1 commit into
Open
Conversation
- Add i18n module with translation support - Create English and Chinese locale files - Add language configuration via hc config command - Support HARNESSCODE_LANGUAGE environment variable - Update all user-facing CLI messages to use translations - Update README documentation with language configuration - Keep source code comments and logs in English Features: - hc config language zh # Switch to Chinese - hc config language en # Switch to English - HARNESSCODE_LANGUAGE=zh hc # Use environment variable Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add internationalization (i18n) support for HarnessCode CLI, allowing users to switch between English and Chinese interface while keeping source code comments and logs in English.
Features
hc config language zh- Switch to Chinese interfacehc config language en- Switch to English interfaceHARNESSCODE_LANGUAGE=zh hc- Use environment variable for languageChanges
New Files
src/harnesscode/utils/i18n.py- i18n module with translation loadersrc/harnesscode/locales/en.json- English translationssrc/harnesscode/locales/zh.json- Chinese translationsModified Files
src/harnesscode/cli.py- Added translation support andhc configcommandsrc/harnesscode/installer.py- Updated user-facing messages to use translationssrc/harnesscode/infinite_dev.py- Updated interactive prompts (model selection, branch selection)src/harnesscode/restore_config.py- Updated restore messagessrc/harnesscode/utils/config.py- Addedget_language_from_config()functionREADME.md- Added language configuration documentationREADME_CN.md- Added language configuration documentationDesign Principles
Testing
Tested the following scenarios:
hc,hc --help)HARNESSCODE_LANGUAGE=zh hc)hc config)Usage