Skip to content

Chinese copy still falls back to English in the console and stats pages #50554

Open

Description

@PangYiMing

Description

The Simplified Chinese dictionaries for the console and the stats site carry every key the English source has, but a few values were still left in English.

Console (packages/console/app/src/i18n/zh.ts): the enterprise security and compliance FAQ (enterprise.faq.q5, a5.before, a5.after) is not translated, and the Data navigation item, the GitHub star label, the bench commit label and the contact link stay English.

Stats (packages/stats/app/src/i18n/zh.ts): five model metric card labels stay English — Total spend, Cost input, Cost output, Average cost / Session and Average tokens / session.

Plugins

None.

OpenCode version

V2 (v2 branch).

Steps to reproduce

  1. Open the console with the language set to 简体中文 and scroll to the enterprise FAQ.
  2. Open a stats model page with 简体中文 selected and look at the metric cards.

Expected: those strings read in Simplified Chinese.
Actual: they are shown in English.

Screenshot and/or share link

Not attached; the affected strings are listed above with their keys.

Operating System

macOS 26 (Apple Silicon)

Terminal

Not applicable (web pages)

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed list. I confirmed this on the latest dev (fa1260d) by loading the zh dictionaries directly. The script below prints the value each key resolves to.

    Still English in Simplified Chinese:

    • Stats (packages/stats/app/src/i18n/zh.ts): model.totalSpendLabel, model.costInput, model.costOutput, model.averageCostSession, model.averageTokensSession. These are the metric card labels on the model page.
    • Console (packages/console/app/src/i18n/zh.ts): the enterprise FAQ enterprise.faq.q5 / a5.before / a5.after and home.growth.githubStars. nav.data has no Chinese entry, so the Data nav item shows the English text.

    I couldn't find the bench commit label or the contact link key under those names in the current console en.ts, so those may already have changed.

    Your PR #50550 covered these strings, but it was closed by the automated cleanup of old PRs, not after review. Related: #50299 (Console localization in general).

    Reproduction script (check-zh.ts)
    // Run from a checkout root: bun /path/to/check-zh.ts [repoDir]
    // Prints the zh value next to the English source for the strings named in #50554.
    const repo = process.argv[2] ?? "/workspace/repo"
    const statsEn = (await import(`${repo}/packages/stats/app/src/i18n.ts`)) as any
    const statsZh = (await import(`${repo}/packages/stats/app/src/i18n/zh.ts`)).dict as Record<string, string>
    const consoleEn = (await import(`${repo}/packages/console/app/src/i18n/en.ts`)).dict as Record<string, string>
    const consoleZh = (await import(`${repo}/packages/console/app/src/i18n/zh.ts`)).dict as Record<string, string>
    
    let untranslated = 0
    function check(app: string, en: Record<string, string> | undefined, zh: Record<string, string>, keys: string[]) {
      for (const k of keys) {
        const v = zh[k]
        const e = en?.[k]
        const same = v !== undefined && /^[\x00-\x7F]*$/.test(v)
        if (same) untranslated++
        console.log(`${same ? "ENGLISH" : "ok     "} ${app} ${k}: zh=${JSON.stringify(v)}${e !== undefined ? ` en=${JSON.stringify(e)}` : ""}`)
      }
    }
    check("stats", undefined, statsZh, [
      "model.totalSpendLabel",
      "model.costInput",
      "model.costOutput",
      "model.averageCostSession",
      "model.averageTokensSession",
    ])
    const consoleKeys = Object.keys(consoleEn).filter((k) =>
      /^(nav\.data|enterprise\.faq\.(q5|a5)|bench\.detail\.labels\.commit)/.test(k) || /star|contact/i.test(k),
    )
    check("console", consoleEn, consoleZh, consoleKeys)
    console.log(`\n${untranslated} zh value(s) still pure ASCII/English`)

    Run it: bun check-zh.ts

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions