Skip to content

Feature support i18n for cn-ZH and en-US#322

Open
dkzjq wants to merge 5 commits intomicrosoft:mainfrom
dkzjq:feature_support_i18n
Open

Feature support i18n for cn-ZH and en-US#322
dkzjq wants to merge 5 commits intomicrosoft:mainfrom
dkzjq:feature_support_i18n

Conversation

@dkzjq
Copy link
Contributor

@dkzjq dkzjq commented Aug 6, 2025

Title:

Feature for support i18n for cn-ZH and en-US language

Description:

Support i18n-react for frontend and support different language for backend websocket message

Problem:

--

Solution:

Support i18n-react for frontend and support different language for backend websocket message

Changes:

Support i18n-react for frontend and support different language for backend websocket message

image

Impact:

--

Notes:

Please review the implementation and provide feedback. Let me know if additional tests or adjustments are required.

@matheusmaldaner
Copy link
Contributor

Hi @dkzjq thank you for the contribution. Could you change the default language to English for both the frontend and backend? Could you also ensure that all comments in any part of the code are written in English?

Once that is done, could you create a new PR with only the translational changes? The current PR proposes changes that are not described in the description and that go beyond purely cosmetic translation, which makes it harder for the team to review.

@dkzjq
Copy link
Contributor Author

dkzjq commented Aug 21, 2025

Already push commit.
I set default language to en-US. Fix all code comment in english.
Please review again.Thx

liyijie added a commit to liyijie/magentic-ui that referenced this pull request Dec 13, 2025
Merge and resolve conflicts from PR microsoft#322 (dkzjq:feature_support_i18n)

Frontend changes:
- Add react-i18next, i18next, i18next-browser-languagedetector
- Add i18n configuration (frontend/src/i18n/index.ts)
- Add translation files (en-US.json, zh-CN.json) with ~460 keys each
- Apply useTranslation() hook to all UI components:
  - Header, Sidebar, Settings (General/Agent/Advanced)
  - Chat (input, plan, approval, sample tasks)
  - Plans (list, card, learn button)
  - MCP servers configuration
  - File renderer, Sign-in modal, etc.

Backend changes:
- Add i18n module (src/magentic_ui/backend/i18n/)
- Add message definitions and translations for WebSocket messages

Conflict resolution:
- Preserved main's useDefaultModel hook refactoring
- Preserved main's MCP servers new file structure
- Applied i18n to all new components added after PR base
- Kept all existing functionality intact

Language detection: localStorage > navigator > htmlTag
Default fallback: en-US

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: dkzjq <dkzjq@users.noreply.github.com>
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.

2 participants