Skip to content

Commit 2d5cae2

Browse files
committed
docs(spec): label resolver prose matches the limb order and the one-repo home
The script-preference row sits before limbs 2 and 3 where the code runs it, and the parity note no longer calls a change a two-repo decision. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxSGAjHBvjATmenUGp
1 parent 4b4e003 commit 2d5cae2

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎packages/spec/src/ui/i18n-label-resolver.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* `I18nLabelSchema` (see `./i18n.zod`) authorizes two forms of a display label:
1111
* a plain string, and an inline locale map `{ en: 'Owner', 'zh-CN': '负责人' }`.
1212
* Until now only ONE end of the platform knew what the second form *means*:
13-
* objectui's `pickLocalized`. Every backend producer that had to put a label on
13+
* the renderer's `pickLocalized` (then in objectui). Every backend producer that had to put a label on
1414
* the wire tested `typeof label === 'string'` and dropped anything else — so a
1515
* dataset that declared its dimension label the way the schema authorizes shipped
1616
* `fields[]` entries with **no label at all**, or with the machine name published
@@ -23,10 +23,10 @@
2323
* two enrichment sites and `dataset-compiler.ts:374/406` — is #6761 and is
2424
* deliberately NOT implemented here.
2525
*
26-
* ## Rule parity with objectui's `pickLocalized` is the contract
26+
* ## Rule parity with the renderer's `pickLocalized` is the contract
2727
*
2828
* The ruling's acceptance hinge is not this function's shape but that it picks
29-
* **the same entry** objectui would, for the same map and the same locale. Two
29+
* **the same entry** the renderer would, for the same map and the same locale. Two
3030
* resolvers that disagree render the same metadata differently on the two ends
3131
* with neither side erroring — the server-rendered column header and the
3232
* client-rendered one simply differ.
@@ -40,9 +40,9 @@
4040
* | 0 | plain string ⇒ itself | pass-through, `''` included |
4141
* | — | `locale` normalization | `(locale \|\| 'en').trim()`; **no** case folding |
4242
* | 1 | exact tag — `map[locale]` | `zh-CN` matches the key `zh-CN` |
43+
* | 2–3 | before limbs 2 and 3, where the platform splits the base by script: the base or first sibling of the locale's own script | `zh-Hant` over `{ zh-CN, zh-TW }` → `zh-TW`; only `zh` splits today; see {@link scriptEntryKey} |
4344
* | 2 | base language — `map[base]` | `zh-CN` → `zh` |
4445
* | 3 | first region-qualified sibling sharing the base | `zh` → `zh-CN`; **key insertion order** decides |
45-
* | 2–3 | …an entry of the locale's own script first | `zh-Hant` over `{ zh-CN, zh-TW }` → `zh-TW`; see {@link scriptEntryKey} |
4646
* | 4 | `map.default` | the untagged entry `InlineLocaleMapSchema` admits |
4747
* | 5 | `map.en` | the platform's source language |
4848
* | 6 | first string value | insertion order again |
@@ -74,8 +74,8 @@
7474
* case — but parity with the reference is the ruled acceptance, and a resolver
7575
* that folded case would answer differently from the renderer for exactly the
7676
* inputs where it "improved". The asymmetry is pinned as-is, with vectors, in
77-
* `i18n-label-resolver.test.ts`; changing it is a two-repo decision, not a
78-
* detail to fix in passing.
77+
* `i18n-label-resolver.test.ts`; changing it means changing both twins in this
78+
* repository together (and their parity pins), not a detail to fix in passing.
7979
*
8080
* ## Rule departures — converged as of objectui#3907, zero remain
8181
*
@@ -137,7 +137,7 @@
137137
* `system/i18n-resolver.ts` resolves form **1** — a plain-string label plus a
138138
* translation *bundle*, addressed by convention
139139
* (`objects.<object>._views.<view>.label`). This module resolves form **2**, the
140-
* map the author inlined. They compose in that order at objectui's own call
140+
* map the author inlined. They compose in that order at the renderer's own call
141141
* sites (`translateLabel(pickLocalized(label, language), …)`; read points
142142
* recorded in `liveness/page.json`, row `regions`): resolve the inline map
143143
* first, then look the resulting string up in the bundle.
@@ -200,7 +200,7 @@ function readEntry(map: Record<string, unknown>, key: string): string | undefine
200200
* Accepts either authorized form of {@link I18nLabel}: a plain string (returned
201201
* unchanged, `''` included — an author who wrote an empty label wrote a label)
202202
* or an inline locale map, resolved by the six-limb rule documented on this
203-
* module and shared verbatim with objectui's `pickLocalized`.
203+
* module and shared verbatim with `pickLocalized` in `ui/packages/i18n`.
204204
*
205205
* ## The return shape, and why it is not `pickLocalized`'s
206206
*

0 commit comments

Comments
 (0)