Skip to content

spec(ui): NavigationItemSchema.label says a present label "renders verbatim and is never overwritten" without naming the id-keyed translation layer that localizes it — state the one resolution order (objectui#11201 ruling B) #20849

Description

@objectstack-fleet

Filed by the triage seat (objectstack-wide, seat post #6015, session_01AavokzJ5DndAwitDXvKy4U) to carry the spec half of the maintainer's ruling B on objectstack-ai/objectui#11201, with its clarification 「11201 按此」. ⛔ Not a claim, ⛔ not a dispatch. Graded here: documentation · priority:p3 · domain:spec · area:devpath · pm:queue.

The ruling this carries

The maintainer ruled B on objectui#11201: the renderer's rule that translates a present label because its text equals the target's machine name is retired.

Asked whether "if there is an i18n translation, use it; otherwise fall back to the metadata label" is right, the triage seat confirmed it is the platform's existing model, and the maintainer agreed (「同意」). Translation is keyed by the entry's identity, never by its text.

The text that caused the question

packages/spec/src/ui/app.zod.ts (read on origin/main 30839063b5), BaseNavItemSchema.label, the JSDoc and the describe at :321–:324: "…a present label renders verbatim and is never overwritten…".

  • The sentence was written about inheritance: a present label is never replaced by its target's label.
  • It does not mention translation. Read literally, it forbids what translateApp (packages/spec/src/system/i18n-resolver.ts:1153, wired as app: translateApp at :1053) already does. At the /meta boundary it replaces a node's label with apps.<app>.navigation.<id>.label for the active locale chain, keyed by the node's stable id.
  • label is also an I18nLabelSchema, so an inline locale map is a second identity-keyed route.
  • That gap is what made objectui#11201's question look open.

Direction

One wording change, in the JSDoc and the describe, stating the resolution order once:

  1. A present label is the author's source text. It is localized by the entry's own translation, keyed by its id:
    • the bundle entry apps.<app>.navigation.<id>.label for the active locale chain (translateApp);
    • else the inline locale map's value for that locale;
    • else it is shown as authored.
  2. It is never replaced by its target's label, and never translated by matching its text against any name.
  3. An absent label inherits its target's current label at render time, which the target's own translation localizes.
  • Name translateApp as the one place the bundle step runs. ⛔ No second resolver in the renderer.
  • Pin: translateApp translates a node whose label equals its target's machine name only through the node's id key; with no such key, the label comes back unchanged. This locks the "never by text" half at the spec.
  • Regenerate whatever the describe feeds (JSON schema, reference docs) in the same PR.
  • ⛔ No schema change: the key stays I18nLabelSchema, optional.

Related

  • objectui#11201: the renderer half. Stage 1 stops producers writing machine-name labels and runs the census.
  • objectui#11198: the skills guide sentence. It may add "a present label is shown as authored, localized by its own translation".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratedocumentationImprovements or additions to documentationdomain:specpriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions