Skip to content

[i18n] systemic gaps: help metadata never translated, ~600 unwrapped message sites, 36 dead keys #1050

Closed

Description

@caomengxuan666

Audit finding (issues/report-i18n-audit.md):

  1. format_help_text in src/core/cmd_meta.cppm only translates generic
    section labels — command.<name>.description/.synopsis/.option.* catalog
    keys exist but are never looked up at render. ~800+ help strings stay
    English under zh-CN.
  2. ~600–800 emission sites bypass i18n: message fragments across multiple
    print calls, ~228 std::unexpected("literal") strings invisible to the
    extractor, ~30 wide L"..." diagnostics (dead legacy keys), direct
    std::format/safePrint literals.
  3. 36 translate()/format() keys in source are absent from the generated
    catalog (wpm×17, dd×2, ln, ls×3, runcon×2, chcon×6, who/tic/toe,
    mkfifo/mknod) so zh-CN can never cover them.

Remediation plan in the report: wrap all literals, teach the extractor the
call sites, translate metadata at render, translate-then-widen for wide
output, and regenerate the catalog.

Activity

  1. added
    i18n
    on Sep 14, 2026
  2. caomengxuan666 commented on Sep 15, 2026

    @caomengxuan666
    MemberAuthor

    Addressed in release/v1.0.6 — the concrete gaps in this report are now closed:

    1. Help metadata: format_help_text already translates command.<name>.description, .synopsis, and every command.<name>.option.* key at render time (plus common.* section labels).
    2. Unkeyed emission sites: all safePrint/safeErrorPrint string literals and std::unexpected("...") payloads are cataloged under legacy.<fnv64> keys and looked up at runtime via translate_legacy / translate_error.
    3. Wide-string diagnostics: safePrint/safeErrorPrint(std::wstring_view) now narrow to UTF-8, consult the catalog, and emit the translation — the ~30 L"..." diagnostic sites are no longer dead.
    4. Keyed call sites: scripts/i18n_batch.py extract now scans i18n::translate("key","fallback") and i18n::format("key","fallback",...) calls (literal args only), so keys no longer depend on the hand-maintained MANUAL_MESSAGES table. The regenerated catalog gained 64 previously-invisible keys (dd/numfmt/chcon/mktemp/runcon/tic/toe/who/wpm/expr/factor/tr/readlink/realpath/sleep error+warning strings).
    5. zh-CN catalog synchronized: +64 new, -4 stale, placeholder validation clean; VERSION bumped in unixwin/winuxcmd-i18n.

    Remaining raw literals (file contents, dynamic fragments) are intentionally not extracted per the documented boundary in i18n_batch.py.

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

    i18n

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions