fix(editor): code the engine-composed form labels and notes for translation #257
No reviewers
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!257
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/236"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #236
What
Every editor-facing label and note the engine composes in Go now carries an
apimsgcode next to its English text, which is unchanged byte for byte. The client translates the code through its catalog.Server
internal/apimsg/codes_core.go:label.title,label.date,label.statuslabel.addressSegmentlabel.backendLayout,label.backendLayoutNextLevelnote.followsSource,note.followsSourceElement,note.homeAlwaysPublishedelement.FormFieldgainsnoteCode.element.Paramgains an internalLabelCode(json:"-"). Sidecars cannot set it, because they decode strictly intoRawParam; a test pins this.Schema.Describehands it on asFormField.LabelCode, so the engine-built params carry their codes: the implicit title, the translation slug and both layout pickers.editormodule.FieldInfoandFiltergainlabelCode. The built-in title/date/status label carries its code; a declared label clears it.buildFiltertakes the resolvedFieldInfo, so the filter's label and code have one owner.internal/server/forms.go, found while grepping).web/src/i18n/servermessages.jsonis regenerated.Client
web/src/api/labels.tsdisplayLabel(text, code)is the one place that turns a coded label, note or built-in title into display text. #227 will extend it.decodeFormDescription(forms.ts),fetchModules(modules.ts),decodeTree(tree.ts) and the pending list (publish.ts) call it; none inlines the lookup any more.en.jsonandde.jsonhave aserver.*entry for every new code. The German followsglossary.md: Titel, Adresssegment, Backend-Layout, …Docs: the README API section documents
labelCode/noteCodeon form fields andlabelCodeon module fields, filters and options.scaffold/site/AGENTS.mdand the skills document none of these wire shapes and need no change.Verification
make testpasses: Go, and vitest with 121 files and 3125 tests, the i18n parity test included.make buildpasses, andgo vetandgofmtare clean.labels.test.ts) cover the helper, anddescribeForm/fetchModulesin German and in English, where the English result equals exactly what the server sent.harness serveontestdata/multilingual-site, thenPOST /api/formfor theabout.mdtranslation (lang: de). The title field returnslabelCode: label.titleand the slug fieldlabelCode: label.addressSegment, both with unchanged English labels.Left as is
settings.on/off, not in a label or note field; that could be a follow-up.pageops/translation.gofallbackTitlewrites "Home" into front matter. That is content, not a label.🤖 Generated with Claude Code
[autoland] verdict: pass
PASS — validated by the autoland lander.
Signal: CI aggregate
success(ci / build-and-test: npm build + vitest, go vet, go test ./..., go build — runs unconditionally, so it exercised every touched path). gofmt clean on the changed Go files.Conventions: Conventional Commits title
fix(editor): …; body carriesCloses #236; branch is at main's head (2bbb43f), no conflict.Scope vs #236: every engine-composed label/note is coded beside unchanged English — implicit title (internal/pageops/settings.go:620), address segment (translation_settings.go:761), both layout pickers (settings.go:429-430), module built-ins title/date/status + status filter (editormodule/load.go:135, :216), read-only translation note (translation_settings.go:74), home Enabled note (settings.go:189), plus the synced-element note (server/forms.go:575) found by the issue's grep check. Param.LabelCode is json:"-" and sidecar-unsettable (pinned by element/load_test.go). Client has one owner, web/src/api/labels.ts displayLabel, called by forms.ts, modules.ts, tree.ts, publish.ts; no inline lookup remains. en/de catalogs and servermessages.json updated; German follows glossary.md (Titel, Backend-Layout, Standardsprache; Adresssegment matches existing de.json usage). README documents labelCode/noteCode. AGENTS.md and the scaffolded skills document none of these wire shapes — no change needed.