Skip to content

[Bug]: the TUI's language follows the OS user locale, so 30 cases fail on a Chinese-locale Windows host #19

Closed as not planned

Description

@antianqi

Product or interface: Source build or repository tooling
Version: source commit main (541bf9b3), Node 24.18.0, pnpm 10.x
Platform: Windows
OS version and architecture: Windows 11 x64 (10.0.26100)
Issue area: Build / CI / source distribution

What happens

The TUI's language comes from the operating system's user locale. The suite runner already tries to pin the locale (LANG=C, LC_ALL=C, LC_MESSAGES=C), and on POSIX Node derives its default locale from those variables, so the suite runs in English. On Windows no environment variable changes it: LC_ALL, LANG, NODE_ICU_DATA and ICU_DEFAULT_LOCALE were each measured to leave the locale alone, and Node reads the OS user default instead.

So on a host whose user locale is Chinese, the TUI renders Chinese while the cases assert English.

Measured

On a zh-CN Windows host, node scripts/run-vitest-suite.mjs capability reports 47 failed / 6380 passed / 63 skipped. Of those, 30 are this one cause:

file failures
packages/tui/test/unit/tui-app.test.ts 15
packages/tui/test/unit/tui-session-mutation-panels.test.ts 13
packages/tui/test/unit/tui-session-history-flow.test.ts 1
packages/tui/test/unit/tui-status-line-items.test.ts 1

Pinning the locale makes all 30 pass, with nothing else changed. A probe that forces Intl.DateTimeFormat.prototype.resolvedOptions() to return en-US:

file before after
tui-app.test.ts 15 failed pass
tui-session-mutation-panels.test.ts 13 failed pass
tui-session-history-flow.test.ts 1 failed pass
tui-status-line-items.test.ts 1 failed pass

The product already has per-locale copy (copy.en.ts / copy.zh-Hans.ts) and several components take a locale option — the cases that assert Chinese copy pass locale: 'zh-CN' explicitly. It is the default path that follows the OS.

Why it is worth an entry point

The TUI resolves the locale in several places by calling Intl.DateTimeFormat().resolvedOptions().locale directly — for example packages/tui/src/tui/features/composer/copy.ts, packages/tui/src/tui/features/session-mutation/copy.ts, packages/tui/src/tui/features/settings/status-line-copy.ts, packages/tui/src/tui/shell/chrome.ts, packages/tui/src/tui/features/changelog/content.ts.

An explicit entry point — an environment variable or a setting the runtime reads — would give two things at once: a user on a Chinese Windows host could pin the TUI's language, and the suite could pin it deterministically on every platform.

What a fix looks like

  • Resolve the locale in one place instead of at each call site.
  • Let an explicit value win over the OS default, so both the suite and a user can pin it.
  • The suite runner's existing locale pin then works on Windows too.

Nothing here needs a change to what the TUI shows by default — only a way to override it.

Activity

  1. Fectivnfy112357 commented on Nov 20, 2026

    @Fectivnfy112357
    Contributor

    Reproduced all 30 TUI failures under a zh-CN ICU default on Linux. PR #51 adds MCODE_TUI_LOCALE and pins the test runner explicitly. The same four suites now pass all 487 tests with the English override, and the regression confirms the Chinese host fallback still works. Closing as addressed by the submitted PR, pending merge. Native Chinese-locale Windows execution remains unverified.

  2. Fectivnfy112357 commented on Nov 20, 2026

    @Fectivnfy112357
    Contributor

    Closing disposition corrected: this is a TUI locale issue for the upstream MiniMax-AI/minimax-code project. We reproduced 30 failures with a zh-CN ICU default on Linux. Native Chinese-locale Windows execution was not verified. The WebUI fork patch was fully reverted and PR #51 was closed without merging. The issue is closed here as out of scope for this fork. No upstream issue was filed.

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