|
10 | 10 | * `I18nLabelSchema` (see `./i18n.zod`) authorizes two forms of a display label: |
11 | 11 | * a plain string, and an inline locale map `{ en: 'Owner', 'zh-CN': '负责人' }`. |
12 | 12 | * 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 |
14 | 14 | * the wire tested `typeof label === 'string'` and dropped anything else — so a |
15 | 15 | * dataset that declared its dimension label the way the schema authorizes shipped |
16 | 16 | * `fields[]` entries with **no label at all**, or with the machine name published |
|
23 | 23 | * two enrichment sites and `dataset-compiler.ts:374/406` — is #6761 and is |
24 | 24 | * deliberately NOT implemented here. |
25 | 25 | * |
26 | | - * ## Rule parity with objectui's `pickLocalized` is the contract |
| 26 | + * ## Rule parity with the renderer's `pickLocalized` is the contract |
27 | 27 | * |
28 | 28 | * 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 |
30 | 30 | * resolvers that disagree render the same metadata differently on the two ends |
31 | 31 | * with neither side erroring — the server-rendered column header and the |
32 | 32 | * client-rendered one simply differ. |
|
40 | 40 | * | 0 | plain string ⇒ itself | pass-through, `''` included | |
41 | 41 | * | — | `locale` normalization | `(locale \|\| 'en').trim()`; **no** case folding | |
42 | 42 | * | 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} | |
43 | 44 | * | 2 | base language — `map[base]` | `zh-CN` → `zh` | |
44 | 45 | * | 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} | |
46 | 46 | * | 4 | `map.default` | the untagged entry `InlineLocaleMapSchema` admits | |
47 | 47 | * | 5 | `map.en` | the platform's source language | |
48 | 48 | * | 6 | first string value | insertion order again | |
|
74 | 74 | * case — but parity with the reference is the ruled acceptance, and a resolver |
75 | 75 | * that folded case would answer differently from the renderer for exactly the |
76 | 76 | * 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. |
79 | 79 | * |
80 | 80 | * ## Rule departures — converged as of objectui#3907, zero remain |
81 | 81 | * |
|
137 | 137 | * `system/i18n-resolver.ts` resolves form **1** — a plain-string label plus a |
138 | 138 | * translation *bundle*, addressed by convention |
139 | 139 | * (`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 |
141 | 141 | * sites (`translateLabel(pickLocalized(label, language), …)`; read points |
142 | 142 | * recorded in `liveness/page.json`, row `regions`): resolve the inline map |
143 | 143 | * first, then look the resulting string up in the bundle. |
@@ -200,7 +200,7 @@ function readEntry(map: Record<string, unknown>, key: string): string | undefine |
200 | 200 | * Accepts either authorized form of {@link I18nLabel}: a plain string (returned |
201 | 201 | * unchanged, `''` included — an author who wrote an empty label wrote a label) |
202 | 202 | * 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`. |
204 | 204 | * |
205 | 205 | * ## The return shape, and why it is not `pickLocalized`'s |
206 | 206 | * |
|
0 commit comments