zeroclaw/src/agent
Argenis 81d99f513c
feat(i18n): externalize tool descriptions for translation (#3912)
Add a locale-aware tool description system that loads translations from
TOML files in tool_descriptions/. This enables non-English users to see
tool descriptions in their language.

- Add src/i18n.rs module with ToolDescriptions loader, locale detection
  (ZEROCLAW_LOCALE, LANG, LC_ALL env vars), and English fallback chain
- Add locale config field to Config struct for explicit locale override
- Create tool_descriptions/en.toml with all 47 tool descriptions
- Create tool_descriptions/zh-CN.toml with Chinese translations
- Integrate with ToolsSection::build() and build_tool_instructions()
  to resolve descriptions from locale files before hardcoded fallback
- Add PromptContext.tool_descriptions field for prompt-time resolution
- Add AgentBuilder.tool_descriptions() setter for Agent construction
- Include tool_descriptions/ in Cargo.toml package include list
- Add 8 unit tests covering locale loading, fallback chains, env
  detection, and config override

Closes #3901
2026-03-24 15:17:33 +03:00
..
agent.rs feat(i18n): externalize tool descriptions for translation (#3912) 2026-03-24 15:17:33 +03:00
classifier.rs feat(agent): log query classification route decisions 2026-02-24 16:02:59 +08:00
dispatcher.rs fix(agent): prevent duplicate tool schema injection in XML dispatcher (#3744) 2026-03-24 15:17:21 +03:00
loop_.rs feat(i18n): externalize tool descriptions for translation (#3912) 2026-03-24 15:17:33 +03:00
memory_loader.rs fix(memory): filter autosave noise and scope recall/store by session (#3695) 2026-03-24 15:17:18 +03:00
mod.rs feat(agent): add rule-based query classification for automatic model routing 2026-02-18 14:41:58 +08:00
prompt.rs feat(i18n): externalize tool descriptions for translation (#3912) 2026-03-24 15:17:33 +03:00
tests.rs fix(agent): prevent duplicate tool schema injection in XML dispatcher (#3744) 2026-03-24 15:17:21 +03:00