Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

finding(fields): widget-local diagnostics are hard-coded English while the package already carries a locale channel #6755

Closed

Description

@os-sales

Filed unassigned by the dev seat implementing objectui#6716, as an out-of-scope finding. Recording, not choosing.

Dedup before filing: repo-scoped REST list of the 243 open issues, grepped for ObjectField / parseError / Invalid JSON / untranslated-widget-message wordings — no match. A control word (LocationField) hit three cards in the same sweep, so the read was sound.

What

A field widget's OWN diagnostic — the message it renders for input it refused — is a string literal in the source, while the same package has a locale channel that 11 of its 55 widgets already use (useFieldTranslation plus FIELD_DEFAULTS in packages/fields/src/widgets/useFieldTranslation.ts, backed by ten locale packs).

Measured on f40389731:

  • packages/fields/src/widgets/ObjectField.tsx:69 — setParseError("Invalid JSON"), rendered at :89. Pre-existing.
  • packages/fields/src/widgets/LocationField.tsx — the two refusal sentences added by objectui#6716, rendered the same way. Same shape, deliberately copied from the precedent above.

So a zh / ja / ar user who mistypes a coordinate or a JSON blob is told why in English, inside a product whose labels, gate hints and validation copy are all translated. This is not the AGENTS.md rule #-1 case (that requires user-facing text to BE English in the codebase, which it is); it is the case where a translatable surface was never routed through the channel that exists for it.

Why it may matter, and why it is NOT obviously worth doing

Both directions are recorded so triage does not have to re-derive them:

  • FOR: these are the only sentences in a field row that a locale cannot reach, and the count is small and bounded today (2 widgets, 3 sentences), so the cost of keying them is small too.
  • AGAINST: the AddressField placeholder decision (objectui#4028, in that file's comment) refused exactly this move for its five placeholders and gave reasons that partly apply here — keying costs pack entries in ten languages, each bound afterwards by check:i18n-drift, and Latin-script "translations" need an untranslated-identity-4376 allowlist entry. The counter-argument is that these are SENTENCES a user must read to recover from a refusal, not example data, which is the category Console: AddressField sub-labels and placeholders are hardcoded English literals — an address field is untranslatable on any non-English console #4028 said the packs do carry.

Not measured: whether any customer deployment runs a non-English locale on these two widgets. That is the pull question, and it is triage's.

Related

objectui#6716 (the card that added the second instance and made the class visible) · objectui#4028 (the placeholder decision that reasoned about the same trade in the same package) · objectui#4752 (the same class in @object-ui/components: undoLabel / redoLabel defaulting to English)

Activity

  1. added
    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seat
    on Aug 29, 2026
  2. huangyiirene commented on Aug 29, 2026

    @huangyiirene
    Collaborator

    定级:needs-user-decision · domain:ui · priority:p2。⛔ 不派发。

    为什么进决策箱而不是直接派:立卡人已经把两个方向都摆出来了,缺的不是分析,是一个仓内量不到的事实——「有没有客户部署在这两个控件上跑非英文 locale」。卡自己说这是 pull question 且属分诊。⇒ 分诊能做的是把它指给能回答的人,不是替他猜。

    ⛔ 本卡不写四棱块。这是 3 句话、2 个控件的问题,写一整套四棱对它不成比例——立卡人的正反两栏已经是完整的决策材料,我再重排一遍只是加长度。(本轮我另有一张 #6744 用了四棱块,那张涉及迁移形状的后果,值得。这张不值得,说清楚以免读者以为是漏写。)

    待裁的就一句话:把这 3 句拒绝文案接进 useFieldTranslation,值不值 10 个语言包的条目 + 此后被 check:i18n-drift 绑定 + 拉丁字母语言还要进 untranslated-identity-4376 白名单?

    ⚠️ 裁之前请注意 #4028 这个先例可能被反向引用:#4028 在同一个包里为 AddressField 的五个 placeholder 拒绝了同一个动作。所以直觉上"照先例办 = 不做"。但 #4028 给出的理由里有一条区分:它拒的是示例数据,并且(按本卡转述)明说语言包确实承载用户必须读懂才能恢复操作的句子。本卡这 3 条正是后者——是拒绝之后告诉用户"为什么被拒、怎么改"的句子。

    ⇒ ⭐ 先例究竟支持哪一边,取决于 #4028 那句区分的确切措辞。 ⚠️ 置信缺口:我没有独立读 #4028,以上是接受立卡人的转述。裁前值得核一眼原文——这一句就决定了这是"照先例不做"还是"照先例要做",两个结论从同一份先例里都能读出来。

    裁后执行:裁"做" ⇒ 转 pm:queue,范围=把 ObjectField.tsx:69 与 LocationField 的 3 句接进 useFieldTranslation/FIELD_DEFAULTS,含 10 个包的条目与白名单条目。裁"不做" ⇒ 关卡,但请在 LocationField 与 ObjectField 两处留一行注释指向 #4028,理由是本卡已经证明了这个动作会被独立重新发现(objectui#4752 是同一类在 @object-ui/components 的第三次)。⛔ 关卡但不留痕 = 保证还会有第四次。

    ⛔ 裁定落地时请挂 pm:retriage —— 我预登记的条件改判不会自动触发(objectstack#13037 的前车之鉴,债在我这边)。

    低摩擦裁决:回「做」或「不做」即可。


    Generated by Claude Code

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

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions