#1457·codeburn

Add i18n support: localized CLI output (zh-CN, zh-TW, ja, ko, fr)

Author: pixelxiaoCreated Sep 16, 2026Updated Sep 17, 2026
Labelsenhancementarea: clistatus: has-pr

Proposal

Add an internationalization (i18n) layer so CLI output (labels, table headers, section titles, summary lines) can be displayed in languages other than English.

Requested locales (initial set)

  • en (default, unchanged behavior)
  • zh-CN (Simplified Chinese)
  • zh-TW (Traditional Chinese)
  • ja (Japanese)
  • ko (Korean)
  • fr (French)

Proposed design (looking for maintainer feedback before writing code)

  1. New module src/i18n/: a hand-rolled, dependency-free locale catalog (one TS file per locale) plus a t(key, vars?) lookup with English fallback for missing keys. No new runtime dependencies.
  2. Locale resolution order: codeburn language <code> config (new subcommand, stored in the existing config.json) → CODEBURN_LANG env → LANG/LC_ALL env (e.g. zh_CN.UTF-8) → en.
  3. Scope of this first PR: user-facing strings of the read-only report surfaces — status, overview, report/today/month dashboards (table headers like Cost/Tokens/Share, section titles like By tool / Top models / Daily, totals labels). Parser logic, provider code and the menubar JSON contract are untouched.
  4. Tests: fixture-based tests/i18n.test.ts covering locale resolution, fallback behavior, and that zh-CN output contains no untranslated catalog keys; plus asserting npm test parity with main.
  5. Numbers, currency symbols and model names stay as data (not translated); currency display remains governed by the existing currency config.

Non-goals for this PR

  • Translating commander --help text (follow-up PR if the approach is accepted)
  • menubar / Electron / GNOME UI strings (follow-up)

Happy to adjust scope or mechanism (e.g. JSON catalogs instead of TS, different env var name) to match maintainer preferences. If this is welcome, I'd implement it against main with full-suite verification per CONTRIBUTING.