Skip to content

[Feature Request] Add i18n support / Chinese localization #1219

Closed

Description

@MLYR

Is your feature request related to a problem? Please describe.

CodeBurn is a great local tool for tracking AI coding token usage, but the UI (CLI output and the local dashboard) is hardcoded in English only. It is quite popular among Chinese developers, and a localized version would make it much more accessible to them.

Describe the solution you would like

Add internationalization support:

  • Extract user-facing strings from src/ and dash/src/ into resource files
  • Support a --lang / config option (e.g. LANG env or codeburn config set lang zh-CN)
  • Ship at least en and zh-CN (Simplified Chinese) locales
  • Apply to both the CLI/Ink UI and the web dashboard

Describe alternatives you have considered

  • A third-party translation patch fork (fragile, hard to maintain)
  • Keeping it English-only (fine, but limits adoption)

Additional context

  • The codebase currently has no i18n library (no i18next / react-i18next in dependencies)
  • Happy to help with implementation / PR review if the maintainers are open to it

I am happy to submit a PR if the direction is agreed. Thanks for the great tool!

Activity

  1. TheCrazyAnt commented on Sep 3, 2026

    @TheCrazyAnt
    Contributor

    Hi — I've been running a Simplified Chinese build of the macOS menubar app for a while and would like to contribute it, if the approach fits.

    What it looks like on the Swift side (no third-party library):

    • Localizable.strings in en.lproj / zh-Hans.lproj shipped in the main bundle, so every SwiftUI literal (Text("…"), Button("…"), .help("…") …) resolves on its own.
    • Two tiny helpers for the rest: L("…") (String(localized:), keeps interpolation as %@/%lld) for plain-String UI text, and LR(x) for labels that arrive at runtime from the CLI payload (activity names, period labels), which look themselves up and fall back to the English text.
    • A Settings › General › Language picker (System / English / 简体中文) that writes the per-app AppleLanguages default, plus two small scripts (extract_keys.py / merge_strings.py) so another language is just another .lproj.
    • ~720 strings translated; English remains the development language, so nothing changes for existing users.

    This is only the menubar app — the CLI/Ink output and the web dashboard from the original request are a separate job (different stack), and I'd keep them out of this PR.

    I have the branch ready and can open the PR right away if you're open to it. Happy to adjust the mechanism (e.g. String Catalogs) if you'd prefer a different shape.

  2. ozymandiashh commented on Sep 11, 2026

    @ozymandiashh
    Collaborator

    The macOS menubar half is up as #1289: Localizable.strings for en and zh-Hans shipped as SwiftPM target resources, no third-party library, language chosen by the system, which matches the approach @TheCrazyAnt described above. @TheCrazyAnt, you have been running a zh-Hans build for a while, so your review of the translation would be worth more than anything else on that PR; corrections welcome as suggestions or as a follow-up commit. The CLI and web dashboard are a different stack and stay out of scope for now; I will write up the policy for those here separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions