Skip to content

Conversation

@yanghanze1
Copy link

Description

📝 Description

This PR implements full Internationalization (i18n) support for the opcode application, enabling multi-language interface capabilities. The implementation includes the integration of the react-i18next framework, complete translation resources for English and Simplified Chinese, and the migration of core components to use the new translation system.

Key Changes:

  • Framework Integration: Implemented react-i18next with i18next core, including language checking and extraction tools (i18next-parser).
  • Translation Resources: Created complete resource files for English (en) and Simplified Chinese (zh) across 8 functional namespaces (common, agents, projects, etc.).
  • Component Migration: Migrated 62/79 (78%) of total components, including 89% of core components (e.g., AgentCard, ProjectCard, SettingsDialog).
  • Type Safety: Ensured strict TypeScript compliance for all i18n hooks and keys.

🔧 Approach

  1. Architecture: Adopted react-i18next for React bindings and i18next-browser-languagedetector for automatic language detection.
  2. Resource Structure: Organized translations into namespaces (common, agents, settings, etc.) matching the feature modules for better maintainability.
  3. Extraction: Configured i18next-parser to automate the extraction of translation keys.
  4. Preservation: Technical terms like "Agent", "MCP Server", and "Checkpoint" are intentionally kept in English to maintain professional precision.

🧪 Verification & Testing

All tests passed successfully (See details in .zcf/test-reports/2026-02-01_i18n-implementation-test.md).

Test Item Status Result
Translation Integrity 1028 keys, 100% consistent across languages
TypeScript Check 0 Errors
Production Build Successful (10.89s)
Component Migration 78% Overall, 89% Core
App Startup 397ms, No errors

⚠️ Side Effects / Notes

  • Breaking Changes: None. This is a non-breaking additive feature.
  • Dependencies: Added i18next, react-i18next, i18next-browser-languagedetector, and i18next-parser (dev).
  • Future Work: Remaining minor components will be migrated in subsequent updates.

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.

1 participant