Skip to content

fix(i18n): translate every select option into Simplified Chinese (#645) - #660

Merged
yinlianghui merged 1 commit into
mainfrom
claude/chinese-i18n-issues-lq7hlp
Aug 3, 2026
Merged

fix(i18n): translate every select option into Simplified Chinese (#645)#660
yinlianghui merged 1 commit into
mainfrom
claude/chinese-i18n-issues-lq7hlp

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Description

Fifteen select fields across nine objects had no option labels in any of the four locales. A missing entry is not a runtime error — the resolver falls back to the English label in code, and where a field had no entry at all the picklist rendered the raw stored value.

On an otherwise fully translated Chinese screen that meant a rep saw net_30 in Contract payment terms, bare keys in Task type, and crm_account in a Task's "related to" picker. Contract, Quote and Product were worst hit: crm_product.billing_type and crm_product.unit_of_measure had no zh-CN entry whatsoever, so even the field labels were English.

This completes Simplified Chinese only. en, ja-JP and es-ES keep their ledger rows and remain the open scope of #645.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Related Issues

Related to #645

Changes Made

  • Added zh-CN option labels for 15 select fields over 9 objects (~68 option labels):

    Object Fields
    crm_case type
    crm_contact salutation
    crm_contract billing_frequency, payment_terms, contract_type
    crm_knowledge_article category, tags (partial — 2 and 4 values were missing)
    crm_opportunity competitors
    crm_product family, billing_type, unit_of_measure
    crm_quote payment_terms
    crm_task type, related_to_type, recurrence_type
  • Added the two missing zh-CN field entries outright (crm_product.billing_type, crm_product.unit_of_measure) — these had no label either.

  • Shrank PENDING_SELECT_LABELS in test/metadata-references.test.ts by these 15 rows' zh-CN entries.

  • Retired the UNTRANSLATED_EVERYWHERE shorthand — no row lists zh-CN any more, so it had no remaining use. The doc comment now records that a row regaining zh-CN is a regression rather than a re-scope.

Wording pairs with each field's neighbours in the same bundle rather than rendering the English literally: crm_task.related_to_type's options are object names, so each reuses that object's own label from this same bundle (crm_account → 客户), and crm_quote.payment_terms is worded identically to crm_contract.payment_terms, which shares its option set.

Testing

  • Unit tests pass (pnpm test) — 1172 passed, 1 skipped, 48 files
  • Linting passes (pnpm lint)
  • Build succeeds (pnpm build)
  • Manual testing completed
  • New tests added (if applicable) — no new test; the existing select fields are translated in every locale guard verifies this change by construction. It fails a translated row left in the ledger as stale, so the 15 deletions are only green because all ~68 labels are actually present.

Full objectstack lint (without --skip-i18n) drops from 873 to 803 warnings.

Checklist

  • I have added a changeset.changeset/zh-cn-select-option-labels.md
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation — none needed; no user-facing docs describe these picklists
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works — see Testing above
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Prioritised ahead of the rest of #645 because of a Simplified Chinese customer trial: these picklists sit on the Contract → Quote → Product path a demo walks through, and a raw net_30 in an otherwise Chinese screen is the most visible i18n defect currently shipping.

Two related findings from the same sweep, both out of scope here:

  1. View tab labels have no translation surface at all. 59 tab labels across all 15 objects (account.view.ts:88-94, case.view.ts:50-56, …) are hardcoded English. ObjectTranslationDataSchema in @objectstack/spec@17.0.0-rc.1 carries _views / _sections / _actions but no _tabs, and @objectstack/lint has zero references to tabs — so this is an upstream gap, not something this repo can fix. Filed separately.
  2. i18n: 205 warnings hidden by --skip-i18n; broken option keys and untranslated navigation #494's remaining scope is now almost entirely non-Chinese. Verified against main: its option-key-casing, illegal-enum-key and renamed-field-key buckets are all already fixed, and the largest live item — crm.app.ts has 32 navigation nodes, of which zh-CN translates all 32 while en / ja-JP / es-ES translate 3 each — affects the other three locales.

Generated by Claude Code

Fifteen select fields across nine objects had no option labels in any of the
four locales. A missing entry is not a runtime error — the resolver falls back
to the English label in code, and where a field had no entry at all the picklist
rendered the raw stored value. On an otherwise fully translated Chinese screen
that surfaced `net_30` in Contract payment terms and `crm_account` in a Task's
related-to picker; `crm_product.billing_type` and `crm_product.unit_of_measure`
had no zh-CN entry at all, so even their field labels were English.

Wording pairs with each field's neighbours in the same bundle rather than
rendering the English literally: `crm_task.related_to_type`'s options are object
names and reuse each object's own label from this bundle, and
`crm_quote.payment_terms` matches `crm_contract.payment_terms`, which shares its
option set.

PENDING_SELECT_LABELS shrinks by these 15 rows' zh-CN entries. No row lists
zh-CN any more, so the UNTRANSLATED_EVERYWHERE shorthand is retired; en, ja-JP
and es-ES keep their rows and remain the open scope of #645.

Full `objectstack lint` i18n warnings drop from 873 to 803.

Refs #645.

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

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 3, 2026 2:44am

Request Review

@github-actions github-actions Bot added ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces labels Aug 3, 2026
@yinlianghui
yinlianghui marked this pull request as ready for review August 3, 2026 05:51
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit e68b333 Aug 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants