You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf4fb90
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ui): read every pack by its platform locale tag outside the i18n package
The suites outside ui/packages/i18n that hard-coded ten packs, a zh / pt
key, a 'zh' pack lookup or the menu's 中文 entry now read the platform
locale table or the tag.
Three readers keyed by the old codes are fixed with them. The provider
wrote a booted alias's catalogue (zh, zh-TW, pt) a second time under the
alias, an added event that re-rendered every reader and refetched every
chart for a catalogue already resident; it now writes under the tag. A
stored zh-TW locale took the first offered zh variant (zh-Hans);
pickRenderableLocale now takes the first offered code the table reads as
the same language first. The page-tab label dictionary served its
Simplified rows to every non-exact zh session; a zh-Hant, zh-HK or zh-MO
session reads its Traditional rows.
The en-drift fixtures write a const that is not named by the tag, and a
new describe pins the base-absent follower rule. The generated zh-Hant
pack is recorded as not driver-managed in the merge-driver ledger, and
the converter's declaration twin joins the package's test program. The
changeset declares the change.
Claude-Session: https://claude.ai/code/session_01L6bhgThgWPADcpU1xXCBsw
Co-authored-by: Claude <noreply@anthropic.com>
feat(i18n)!: the Console's language packs are the platform locale table's, keyed by its tags, and Traditional Chinese (`zh-Hant`) ships, generated from Simplified (#30511)
8
+
9
+
Clause-②: yes (narrowing) — widens: a `zh-Hant` pack (the `zhHant` export of `@object-ui/i18n/locales`, the `@object-ui/i18n/locales/zh-Hant` module), the `resolveBuiltInLanguage` export of `@object-ui/i18n`, and every stored or browser code the platform locale table reads as one of its tags (`zh-TW`, `zh-HK`, `zh-MO` → `zh-Hant`; `zh`, `zh-CN`, `zh-SG` → `zh-Hans`; `pt` → `pt-BR`). Narrows: the Simplified Chinese and Portuguese packs are keyed `zh-Hans` and `pt-BR`, no longer `zh` and `pt`, in `builtInLocales`, `BUILT_IN_LANGUAGE_CODES`, `getLoadedBuiltInLocales()` and `getAvailableLanguages()`, and their modules `@object-ui/i18n/locales/zh` and `@object-ui/i18n/locales/pt` are `@object-ui/i18n/locales/zh-Hans` and `@object-ui/i18n/locales/pt-BR`.
10
+
Metadata-protocol: none
11
+
Skills-docs: follow-up owed — `skills/objectui/guides/i18n.md` (its "Built-in locales" list names ten packs, with `zh` and `pt`)
12
+
13
+
<!-- adr-0087: not-required (no-migration-prescription) No metadata changes shape: no spec key, object definition, stored row or authorable spelling is added, removed or renamed, so `objectstack migrate meta` has nothing to rewrite and no ledger entry could project. The FROM/TO lines below are source rewrites for TypeScript and JavaScript consumers of `@object-ui/i18n`'s `./locales` subpath (two members of `builtInLocales`, two modules). That is the class `runtime-export-retired` exists for, but it reads a package's root entry only and refuses a subpath operand, and the root entry retires nothing here; so this category is held, and the gap is named here rather than left to the detector. -->
14
+
15
+
**BREAKING** for code that reads a built-in pack by its old key or module path.
16
+
17
+
-**Why.** The Console's packs follow the platform locale table (`PLATFORM_LOCALES` in `@objectstack/spec/system`, ruling F of #29349) instead of a list of their own: one pack per table tag, keyed by the tag, in the table's order. A language the table gains is a pack the parity and drift suites demand on the run that first sees it.
18
+
-**Traditional Chinese.**`src/locales/zh-Hant.ts` is generated from `zh-Hans.ts` by `pnpm --filter @object-ui/i18n gen:zh-hant` (OpenCC `s2twp`, pinned, with the phrase rules of the www.objectos.ai converter) and is never edited by hand; a package test fails when it is not what the generator writes. It carries no `console.ai.*` gate-only outbound keys, exactly as the other non-gate packs.
19
+
-**Stored codes keep working.** A `sys_user.locale` value, a saved device language or an `Accept-Language` tag written before the table is read through the table's aliases: `zh-CN` still renders Simplified Chinese, `pt` Portuguese (Brazil), and `zh-TW` / `zh-HK` / `zh-MO` now render Traditional Chinese instead of Simplified. `loadBuiltInLocale`, `isBuiltInLanguage` and i18next's fallback chain accept every alias.
20
+
-**Studio.** The Studio namespace still ships `en` and `zh` only; a `zh-Hant` reader sees its Simplified catalogue there.
21
+
22
+
The fix, for code that names a pack:
23
+
24
+
- FROM `builtInLocales.zh` TO `builtInLocales['zh-Hans']`
25
+
- FROM `builtInLocales.pt` TO `builtInLocales['pt-BR']`
26
+
- FROM `import zh from '@object-ui/i18n/locales/zh'` TO `import zh from '@object-ui/i18n/locales/zh-Hans'`
27
+
- FROM `import pt from '@object-ui/i18n/locales/pt'` TO `import pt from '@object-ui/i18n/locales/pt-BR'`
28
+
- FROM comparing a code from `BUILT_IN_LANGUAGE_CODES`, `getAvailableLanguages()` or the keys of `getLoadedBuiltInLocales()` with `'zh'` or `'pt'` TO comparing `resolveBuiltInLanguage(code)` with `'zh-Hans'` or `'pt-BR'`
0 commit comments