Repository navigation
feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation - #36858
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…is stored as that language's translation Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…relaxed rename Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
… for sourceLocale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…nu-rename-translation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 180 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7742278970ec0164a60d3bd306e28ad1ac515b2b && git checkout 7742278970ec0164a60d3bd306e28ad1ac515b2b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5c2e34cdb2b436f356ebba523e284e239f6ea351 2561fd5e28d735caf4367ec82a73cf68960c424c && git checkout -B drift-repro 5c2e34cdb2b436f356ebba523e284e239f6ea351 && git merge --no-ff 2561fd5e28d735caf4367ec82a73cf68960c424c
node scripts/docs-audit/affected-docs.mjs --json 5c2e34cdb2b436f356ebba523e284e239f6ea351
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract-review-claim: session_01WGufzesUz1Y8VZuKJRhVL8 · head 2561fd5 · 2026-11-24T06:00Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract reviewServed-tier: Inputs read: card #36504 (body and all four comments, the claim 7120866660 and the os-dev-report 7123427766 included), PR #36858 (body, 28-file list, net diff against merge-base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix. Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 席位核对 — ACCEPT · repo:objectstack#3 · head 2561fd5 · 2026-11-24T06:05ZL1 read of #36858 against card #36504. Head Face. Read and sound.
Changeset, read sentence by sentence. Every sentence matches the diff except the declaration line noted in N1. No must-fix, no should-fix. Out of scope, for the seat (cards to file at landing; neither is touched by this diff). These are the report's two
Notes (nit, no action required):
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU Landing · 2026-11-24T06:06Z · ACCEPT 7123581719 at head 2561fd5
Open findings: nits only (L1 N1–N4). Two out-of-scope |
…port-editing-own-entry Conflicts with #36858 (menu rename translation), resolved so both survive: - designModeMenuCreate.ts: keep this branch's dashboard-only creator (no report kind, no saveAndPublishInPackage); take #36858's input type `AppMenuSaveInput & { item: NewMenuItem }` and its import, dropping the now-unused `Menu` import, so the dashboard path carries `labels`. - DesignModeMenu.tsx: drop the report-slot block #36858 had edited to pass `labels`; the dashboard save keeps #36858's `labels`. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Requested by Yibo Wang · project thread
Fixes #36504
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #36873 (
skills/objectstack-i18n/SKILL.md:387namesGET /api/v1/i18n/localesbut not its answer, so it does not name thesourceLocalemember this PR adds)repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU
维护者速读
The contract widening (for the contract-tier review)
GetLocalesResponseSchemagains one optional member,sourceLocale: string(packages/spec/src/api/protocol.zod.ts). It is the declaredi18n.sourceLocale, else the default locale: the collapse every metadata-document translator already makes (getSourceLocale?.() ?? getDefaultLocale?.(), the caller's to make per theII18nService.getSourceLocalecontract). It is absent only when the server knows neither. The name follows its config key (i18n.sourceLocale,translation.zod.ts), the precedent being the body's ownisDefaultmark named fori18n.defaultLocale. The shard moved, measured:packages/spec/authorable-surface/api.jsongainsapi/GetLocalesResponse:sourceLocale(regenerated, not hand-edited), soMetadata-protocol: addedand@objectstack/specminor. The one producer is the dispatcher's/i18ndomain (packages/runtime/src/domains/i18n.ts); service-i18n serves no body of its own for this route (its ledger row points at the SDK).What changes
GET /api/v1/i18n/localesnames the source locale (above).labelGoesToTranslation,designModeMenuModel.ts):The dialog says so when the name will be a translation.
designModeMenuSave.ts): thetranslationitemAPP_menu_LOCALE(crm_menu_zh_cn), keyapps.APP.navigation.ID.label(the keytranslateAppreads), in the package the menu is written to: the app's own when writable, else its.custompair (ADR-0146 D2). The item as stored is read through/layers, its other keys kept, and written by the menu's confirmed-save rule (first-write pin, publish pinned to the row read, a refused publish discards the draft). It is written before the menu; a translation-only save writes no app.rebaseMenuEditsnow reports a fresh id throughwrittenAs). Measured:AppSchemaaccepts a label-lessurlentry, so no placeholder is invented; a source-language reader sees the URL until someone names it there.designMode.menu.renameSourceOnlyis replaced byrenameTranslation, andtranslationPendingDraftis added, in all eleven packs (zh-Hant regenerated)./i18n/localessay it names the source locale;content/docs/references/api/protocol.mdxregenerated.Done-when, item by item
GET /i18n/localesexposes the source locale, pinned:packages/runtime/src/i18n-supported-locales.test.ts(realAppPlugin+ memory i18n + dispatcher;defaultLocale: 'zh-CN', sourceLocale: 'en'answerssourceLocale: 'en'; no declaration answers the default) andprotocol.test.ts(the parse keeps the member).translateApp, zh-CN shows the new name and an English reader the base label (designModeMenuSave-36363.test.ts, and end to end inDesignModeMenu-36363.test.tsx).objects.OBJECT...and is read bytranslateObjectwith its own packaged-base and field-patch ranks (ADR-0146 D10), so it needs its own split rule rather than this menu's. The locale read (fetchDeploymentLocales,labelLanguageOf) is shared and reusable.Server-side reach, measured before building the console half
A translation row in the
.custompair is served at rank 1 on the override (getPairTranslationBundle→pairBundle,labelCatalogs), for nodes the override changed and nodes it left alone; the real-boot pin ispackages/objectql/src/protocol-custom-override-bare-slot-envelope.test.ts(the #30504 describe: a node on the pair's override reads the pair's translation). An own-package app's row reaches the deployment catalog through the authored-translation sync.Tests
Local readings (head after the last fix commit)
pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/api/protocol.test.ts src/system/i18n-resolver.test.ts: Test Files 2 passed, Tests 811 passed.pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/i18n-supported-locales.test.ts src/i18n-success-envelope.conformance.test.ts src/domains/i18n-anonymous-deny.test.ts: the anonymous-deny literal needed the new member (fixed in this PR); see the report comment for the final reading.ui:vitest run --maxWorkers=2 packages/app-shell/src/layout/__tests__/ packages/i18n/src/__tests__/plus the two RecordTabsConfig suites (which share the locales read): 271 files, one stale zh-Hant catalogue (regenerated in this PR); final reading in the report comment.pnpm --filter @objectstack/spec check:generated: 14 of 14 current after--fix(check:docs regeneratedprotocol.mdx; authorable-surface regenerated over the merged tree).pnpm --filter @objectstack/runtime typecheck:tsc --noEmitclean;check:test-typechecknames three files this diff does not touch (boolean-written-spelling-row-scope.test.ts,meta-object-publish-column-changes.test.ts,organization-ownership-boot-guard.turso-remote.kernel.test.ts), left to CI's reading.type-checkof@object-ui/app-shelland@object-ui/i18n: NOT MEASURED locally (the ui project references need every ui package'sdist); CI's Type Check UI carries it.Ablations (one per tested behaviour, restored by `git checkout HEAD`, restore proven by an empty `git diff HEAD`)
sourceLocale(ablation-replace.mjsondomains/i18n.ts):i18n-supported-locales.test.tsred (exit 1); restored clean.labelGoesToTranslationanswers "stored" outside the source language:designModeMenuSave-36363.test.tsandDesignModeMenu-36363.test.tsxred (exit 1); restored clean.Acceptance notes
DesignModeMenu.tsx(its removal of the report-slot block meets this PR'slabelsargument on the report save) anddesignModeMenuCreate.ts(imports). Mechanical; the second to land resolves.designModeMenuCreate.tsis touched for one type line (AppMenuSaveInput & { item }) so a dashboard or report created from the picker carries the label language too; without it a zh rename staged before 「New dashboard…」 would be written to the stored label.readAuthoredTranslationLayer); the design mode writes and reads only its ownAPP_menu_LOCALEitem.label: { en, zh-CN }) still replaces the whole map with a string, as before this PR; noted, not changed here.RecordTabsConfig's tab-rename gate still compares the session with the default locale (fetchDefaultLocale, unchanged behaviour); withsourceLocalenow served it can compare with the source locale. Reported to the seat, not changed here.Verification
First read (by risk):
ui/packages/app-shell/src/layout/designModeMenuSave.ts(prepareAppMenuSavelabel split andwriteMenuTranslation),ui/packages/app-shell/src/layout/designModeMenuModel.ts(labelGoesToTranslation,splitLabelEdits,writtenAs),packages/runtime/src/domains/i18n.ts(the locales body).Two minutes:
cd ui && pnpm exec vitest run packages/app-shell/src/layout/__tests__/designModeMenuSave-36363.test.ts— expect theobjectstack#36504describes green, including "a rename under zh-CN over an English source: the zh-CN translation is written and published, the stored label is not".Generated by Claude Code