Skip to content

fix(i18n): the quarter empty state names close_date by its declared label - #1760

Merged
os-bill merged 1 commit into
mainfrom
claude/issue-1750-pipeline-empty-state-close-date
Sep 8, 2026
Merged

os-bill merged 1 commit into
mainfrom
claude/issue-1750-pipeline-empty-state-close-date

Conversation

@os-bill

@os-bill os-bill commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1750

The zh-CN pack contradicted itself. src/translations/zh-CN/objects.pipeline.ts declares the crm_opportunity.close_date label, and sixty-nine lines later its own empty-state message for the closing_this_quarter view named that same field twice by a coined short form. Both strings are shipped Chinese UI: a rep who opened 本季度待成交商机 with no matching records read a message calling the field 成交日期, while the field on every opportunity record — and in the very quarter filter the message describes — is labelled 预计成交日期.

src/ is the source of truth for a label (#1329, AGENTS.md §Documentation discipline rule 6). The contradiction here is inside a single file, so there is no "which surface is authoritative" question to settle first: the declared label governs the prose beside it.

The change

One line, two occurrences, both inside emptyState.message.

Before

message: '本标签页列出成交日期落在当前季度内、且处于承诺(Commit)或最佳可能(Best Case)的进行中商机。当前没有符合条件的记录——成交日期更晚的商机请见“进行中商机”标签页。',

After

message: '本标签页列出预计成交日期落在当前季度内、且处于承诺(Commit)或最佳可能(Best Case)的进行中商机。当前没有符合条件的记录——预计成交日期更晚的商机请见“进行中商机”标签页。',

The straight substitution reads naturally in both positions, so no rephrase was needed.

Untouched, deliberately — none of these spell the field name, and the first is the authority the change follows:

  • close_date: { label: '预计成交日期' }, — the label declaration
  • emptyState.title — 本季度暂无待成交商机
  • the view's own label — 本季度待成交商机

Why this site is worth a card of its own

content/docs/sales/opportunities.* documents this exact tab and its quarter filter. #1733 aligned 56 coined doc sites onto the pack wording across 16 pages — so a reader now follows Chinese docs that say 预计成交日期 and lands on the one screen that still said 成交日期. The split #1733 closed in the docs survived at the place the docs send the reader.

Measurement

The instrument is load-bearing, so it is stated with the reading. grep -P matches bytes under LC_ALL=POSIX and silently drops real hits on multibyte neighbours, so every count below was taken in a UTF-8 locale. The negative lookbehind names both scripts (计 and 計): the coined form is a substring of the correct one, and omitting traditional 計 counts zh-Hant pack sites as coined, which is how an unreachable number gets into a count.

LC_ALL=C.UTF-8 grep -rhoP "(?<[计計])成交日期" src/ | wc -l    → 2 before, 0 after
LC_ALL=C.UTF-8 grep -rhoP "预计成交日期"        src/ | wc -l    → 1 before, 3 after

The arithmetic closes: 1 + 2 = 3. Every occurrence was rewritten in place, none added and none lost.

A zero from a byte-matching grep is not a zero, so the zero above carries a control leg — the same command shape, same corpus, same locale, on a string known to be present:

LC_ALL=C.UTF-8 grep -rhoP "成交概率" src/ | wc -l              → 1

The pattern engine reaches CJK in this tree, so the 0 is a real absence rather than a broken pattern.

Other packs (verified, not assumed). No other locale spells this field in Chinese characters, so the fix stays zh-CN-only:

pack close_date label bare 成交日期 control (known-present)
zh-CN 预计成交日期 0 (was 2) —
ja-JP 完了予定日 0 完了予定日 → 4
es-ES Fecha de Cierre 0 Fecha de Cierre → 2
en Close Date 0 Close Date → 1

Each zero has its own multibyte control leg, so none of them is an instrument failure.

Verification

pnpm verify on commit 16fe217a — real exit code 0, all eight steps:

validate → typecheck → lint → lint:i18n-gate → hygiene → hygiene:tokens → build → test

✓ i18n lint gate: 0 `i18n/missing-*` issues (13 total lint issue(s) reported, unaffected by this gate)
✓ source hygiene clean
✓ source token ratchet clean
  Test Files  164 passed (164)
       Tests  3438 passed | 1 skipped (3439)

The token ratchet reading says nothing about this diff either way — scripts/check-source-token-ratchet.mjs excludes src/translations by maintainer ruling, so this file is outside the surface it measures.

Scope held

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Changeset added — .changeset/quarter-empty-state-names-the-declared-label.md (patch). Not skip-changeset: this ships Chinese UI a user reads.
  • Unit tests pass — 164 files, 3438 passed / 1 skipped
  • Linting passes, including the zero-tolerance lint:i18n-gate
  • Build succeeds
  • Self-review performed; the diff is one line
  • New tests added — deliberately not, see Scope held above

🤖 Generated with Claude Code

https://claude.ai/code/session_019YKN9TPqDSSXUaYqp2j7MZ


Generated by Claude Code

…abel

`src/translations/zh-CN/objects.pipeline.ts` declares
`close_date: { label: '预计成交日期' }`, and its own empty-state message for the
`closing_this_quarter` view named that same field twice by a coined short form
成交日期. Both are shipped Chinese UI, so a rep opening 本季度待成交商机 with no
matching records read a message calling the field 成交日期 while the field in the
very quarter filter being described was labelled 预计成交日期.

`src/` is the source of truth for a label (#1329, AGENTS.md §Documentation
discipline rule 6). The contradiction is inside one file, so the declared label
governs and the prose follows it. The label declaration, the empty-state title
本季度暂无待成交商机 and the view label are untouched — none of them spell the
field name.

Measured in a UTF-8 locale, because `grep -P` matches bytes under `LC_ALL=POSIX`
and silently drops real hits on multibyte neighbours:
`LC_ALL=C.UTF-8 grep -rhoP "(?<![计計])成交日期" src/` reads 2 before and 0 after,
against `预计成交日期` at 1 before and 3 after — rewritten in place, none added
and none lost.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YKN9TPqDSSXUaYqp2j7MZ
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Sep 8, 2026 5:31am UTC

Request Review

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

Labels

metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

2 participants