Commit Graph

1 Commits

Author SHA1 Message Date
olwater
10acfb6fff feat(i18n): introduce internationalization architecture and zh-CN support
This commit adds a robust i18n framework to OpenClaw with the following highlights:

1. Non-invasive Architecture: The core logic remains untouched. The i18n layer acts as a lightweight UI wrapper, ensuring zero side effects on the agent's performance or stability.
2. Seamless Migration: 100% backward compatible. Existing users will notice no change unless the LANG environment variable is explicitly set.
3. Robust Fallback: Implements a reliable fallback mechanism that defaults to English strings if a translation is missing or corrupted.
4. Onboarding Focus: Prioritizes the onboarding wizard and skill descriptions to improve accessibility for Chinese-speaking users.

Changes:
- Implemented a unified t() translation helper.
- Added locales/en.ts (base) and locales/zh.ts.
- Enabled language switching via LANG/LC_ALL environment variables.
- Added comprehensive documentation in i18n/README.md.

Testing: Lightly tested with LANG=zh_cn environment variable
Prompts: Used Claude 3.5 for translation assistance
2026-01-31 00:21:01 +08:00