Skip to content

objectui: ObjectGantt hardcodes Chinese quick-filter labels — English-only-codebase violation, and the gantt toolbar is Chinese in every locale #5427

Description

@yinlianghui

Found while measuring objectstack#5407's item 2 (Clear in list/toolbar chrome). It is not that bug — it is its mirror image — so it is filed separately.

packages/plugin-gantt/src/ObjectGantt.tsx (around line 1384) renders QuickFilterBar with the labels hardcoded in Chinese:

labels={{
  all: '...',            // 全部
  clear: '...',          // 清除筛选
  empty: '...',          // 无可选项
  resultSummary: (shown, total) => `... ${shown} / ${total} ...`,  // 显示 N / M 项任务
}}

QuickFilterBar itself is correct — it is presentational and falls back to English (labels?.clear ?? 'Clear'). The host is what pins the copy.

Two defects in one

  1. AGENTS.md Commandment #-1 — "All user-facing text ... MUST be English. No Chinese or other non-English in those." This is the objectui codebase, not the instruction file, so the rule applies literally.
  2. It is untranslatable. These are not bundle keys, so the gantt quick-filter bar reads Chinese under an en, ja, es, ar … session. The rest of the gantt toolbar localizes fine, which makes the mismatch conspicuous the same way objectstack#5407's item 3 describes for dashboards.

Note for whoever picks this up: resultSummary uses SINGLE-brace interpolation on purpose (the call site does a literal string replace, not i18next), which all-locales-key-parity's placeholder check already knows about — see its SINGLE regex. Any bundle keys added here must keep that spelling or the parity guard will flag them.

Suggested fix

Move all four into the gantt namespace of packages/i18n/src/locales/*.ts (all ten packs — full parity is enforced) and read them through useSafeTranslate, the way DashboardFilterBar already does for dashboard.filters.*.

Activity

  1. self-assigned this
    on Aug 5, 2026
  2. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    认领:objectui 分片 PM 滚动补位第 7 单(bug 优先;#3341 验收后空槽即补)
    会话:session_01GTRjn8xBqp75dk7kFupVRt
    分支:claude/issue-5427-gantt-quickfilter-i18n(代码落地 objectui 仓)
    Worktree:objectui-issue-5427
    域:objectui 分片(plugin-gantt / i18n locales)
    文件面:packages/plugin-gantt/src/ObjectGantt.tsx、packages/i18n/src/locales/*.ts(gantt 命名空间,十包齐,parity 门禁强制)+ 相应测试 + .changeset/*.md(越界即停,报告说明)。与在飞 #3354(types/plugin-charts)、#3305(apps/console)零相交。

    口径照正文:四个 label 进 gantt 命名空间走 useSafeTranslate(照 DashboardFilterBar 的 dashboard.filters.* 先例);resultSummary 保持单花括号插值拼写(parity 守卫的 SINGLE 正则已知此约定,换拼写会被标)。本单同时是 AGENTS.md 诫条 #-1(英文码库)违例清理。


    Generated by Claude Code

  3. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    PM 验收:ACCEPT → objectui PR #3386 已转 ready + auto-merge(报告时 12 项完成全绿、3 项在跑零失败),跟到 MERGED。

    落地内容:四个 label 进 gantt.quickFilter 命名空间十包全补;对派发建议的偏离经复核采纳 —— 复用包内既有 useGanttTranslation 而非另挂 useSafeTranslate(同组件 40+ 串已走前者,第二套机制会拆散英文默认值);随之多改一个文件(useGanttTranslation.ts +7 行英文默认注册,无 provider 嵌入场景的功能必需,非 scope creep,PM 追认)。反向验证方向推理正确:zh 侧单独无法捕获此缺陷(硬编码恰与 zh 文案重合),en 侧 + 字面量反向断言才是承重半边 —— 两者都留。dev 还自纠了一次监控假阳性(未认证 curl 返回空 check_runs 被读成「全完成」),以 MCP 读数为准如实上报。

    衍生:#5446(QuickFilterBar JSDoc 中文注释,observation-class,已带 finding 标签)留分诊轮;#5425 获新鲜证据 —— dev 本会话新写的文件里又冒出裸 U+0000(写入路径活跃复发,非仅存量),已按查重纪律评论至 #5425,该单 dev 正在飞,证据直接可用。

    objectui 分片 PM session_01GTRjn8xBqp75dk7kFupVRt


    Generated by Claude Code

  4. added a commit that references this issue on Aug 6, 2026
    5c856ec
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