WORK-504
ID:WORK-504Status:done

Localize structure & meta-field labels (Zone 1) with auto-derived keys

The highest-visibility surface: the ~68 labels emitted via StructureEntry.label and MetaField.label. Resolve both through the locale table using auto-derived keys.

Priority:highComplexity:moderateMilestone:v0.29.0Source:SPEC-035
claude/milestone-v0-29-0-stzywk View source

Criteria completion

Criteria completion: 4 of 4 (100%) checked; tracking started on Jul 17, no incremental history yet0%25%50%75%100%Jul 17Jul 30

Tracking started Jul 17 — check back for trends.

Branches 2
claude/milestone-v0-29-0-stzywk current done
main doneclaude/multi-language-support-spec-5zzt9q ready
History 4
  1. e86169d
    Content editedby bjornolofandersson
  2. 9a4e4b9
    Created (done)by bjornolofandersson
  3. b34815a
    Content editedby Claude
    i18n: localize structure & meta-field labels with auto-derived keys (WOR
  4. d92ad0c
    Content editedby Claude
    plan: accept SPEC-035, add v0.29.0 milestone + i18n work breakdown

Scope

  • Derive the translation key from the config context: {pluginScope}.{block}.{ref} (Decision D1). Authors don't set keys manually.
  • Add an optional explicit i18nKey override on a structure entry / meta field to pin a stable key across block renames.
  • In buildStructureElement() and the MetaField renderers, resolve the label via resolveLocaleString(ctx, derivedKey, entry.label) — English literal remains the fallback.
  • Apply to both label paths (legacy StructureEntry.label and the SPEC-080 metaFields/blocks MetaField.label) with one shared key-builder.
  • Tests: derived key correctness for both paths, override wins, missing translation → English literal.

Acceptance Criteria

  • Labels from both StructureEntry.label and MetaField.label resolve through resolveLocaleString with auto-derived keys.
  • Optional i18nKey override is honoured and documented.
  • A configured non-English locale renders translated labels; unconfigured keys fall back to the English literal.
  • Zero-config English output unchanged.

Blocked by

  • WORK-503

References

  • SPEC-035 — Zone 1, Decision D1.

Resolution

Completed: 2026-07-17

Branch: claude/milestone-v0-29-0-stzywk

What was done

  • Added i18nKey? override to MetaField and StructureEntry, and scope? to RuneConfig (packages/transform/src/types.ts).
  • assembleThemeConfig stamps each plugin rune's scope from provenance (pluginName); core/local runes stay unstamped (engine defaults to 'core').
  • Added localizedLabel() in the engine — resolves labels via the auto-derived key {scope}.{block}.{ref} (or i18nKey override), English fallback per key. Wired into buildStructureElement (metaText label), renderDefListBlock (<dt>), buildChip, buildLinkValue, buildIconValue.
  • Tests: i18n-labels.test.ts (5) — derived-key translation, per-key fallback, override wins, scope default; assemble scope-stamping test.

Notes

  • Ref = the metaFields key / structure entry ref (verbatim), so extract round-trips. Zero-config English unchanged (606 transform tests pass).