feat: add i18n support with Simplified Chinese (zh-CN) translation#443
Open
yiliqi78 wants to merge 1 commit intowinfunc:mainfrom
Open
feat: add i18n support with Simplified Chinese (zh-CN) translation#443yiliqi78 wants to merge 1 commit intowinfunc:mainfrom
yiliqi78 wants to merge 1 commit intowinfunc:mainfrom
Conversation
…tion
- Set up react-i18next with browser language detection
- Add English (en) and Simplified Chinese (zh-CN) locale files
covering ~271 translation keys across 17 modules
- Create LanguageSwitcher component (globe icon dropdown in titlebar)
- Convert 4 key components as examples:
- CustomTitlebar: tooltip labels, dropdown menu items
- ProjectList: all user-facing strings
- Topbar: status indicator, version display, install prompts
- Settings: header, tab labels, all form labels/descriptions,
toast messages, permission rules section
- Remaining components can be converted incrementally using
the same useTranslation() + t("key") pattern
Translation conventions:
- Agent → 智能体 (not 代理)
- Checkpoint → 检查点
- Token → kept as-is (industry standard)
- Claude Code / opcode → kept as-is (brand names)
- Chinese punctuation used throughout
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
react-i18nextwith browser language auto-detectionLanguageSwitchercomponent (globe icon in titlebar) for easy language switchingCustomTitlebar,ProjectList,Topbar,SettingsMotivation
As noted in the README's contributing section, internationalization is listed as an area for contribution. This PR establishes the i18n foundation and provides a complete Chinese translation, making opcode accessible to Chinese-speaking developers.
What's included
Infrastructure
src/i18n/index.ts— i18next config withLanguageDetector(auto-detects browser locale, persists choice to localStorage)src/i18n/locales/en.json— English translation keys extracted from sourcesrc/i18n/locales/zh-CN.json— Simplified Chinese translationssrc/components/LanguageSwitcher.tsx— Dropdown component for switching languagesConverted components (as examples)
CustomTitlebar.tsxProjectList.tsxTopbar.tsxSettings.tsxTranslation conventions
How to convert remaining components
The pattern is straightforward — each component just needs:
The remaining ~50 components can be converted incrementally in follow-up PRs.
Dependencies added
i18next— Core i18n frameworkreact-i18next— React bindingsi18next-browser-languagedetector— Auto-detect user's browser languageTest plan
tsc --noEmit)