hermes - 💡(How to fix) Fix Feature Request: i18n / 多语言支持(国际化)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. 渐进式覆盖:不需要一次性翻译所有文本,先覆盖最常见的用户可见内容(banner / help / error hints),后续逐步覆盖

Code Example

2 commits behind — run hermes update to update

---

⚠ 落后 2 个提交 — 运行 hermes update 更新
RAW_BUFFERClick to expand / collapse

Feature Description

为 Hermes Agent 增加国际化 (i18n) 支持,允许用户选择界面语言(至少支持简体中文和英文)。

Motivation

目前 CLI 中所有面向用户的文本都是硬编码英文,中文用户看到的提示混杂中英文,体验不好。例如 banner 中的版本更新提示:

⚠ 2 commits behind — run hermes update to update

这类提示如果能根据用户语言设置自动切换为中文会更友好:

⚠ 落后 2 个提交 — 运行 hermes update 更新

不仅仅是 banner,slash command 帮助文本、错误提示、交互引导等场景也需要多语言支持。

Proposed Solution

  1. 语言检测与配置:新增 display.language 配置项(默认 auto,自动跟随系统 locale),支持 en / zh-CN
  2. 翻译文件:引入 locales/ 目录,每种语言一个 .json 文件
  3. 翻译函数:提供 _("key") 包装器,运行时根据 display.language 查表
  4. 渐进式覆盖:不需要一次性翻译所有文本,先覆盖最常见的用户可见内容(banner / help / error hints),后续逐步覆盖
  5. CLI 命令hermes config set display.language zh-CN

Alternatives Considered

  • 直接用系统 Python 的 gettext —— 成熟但需要 .po/.mo 编译流程,对贡献者门槛高
  • 自定义 JSON 翻译表 —— 简单,贡献者友好,适合 CLI 工具的规模
  • 只改硬编码字符串 —— 临时方案,不是长久之计

Additional Context

相关代码位置:hermes_cli/banner.py 第 688-692 行的更新提示是硬编码英文的典型例子。

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING