WORK-503
ID:WORK-503Status:done

Thread LocaleContext into the engine label renderers

buildStructureElement() and the MetaField block renderers currently emit labels as literals and have no access to config — they receive only (entry, name, modifierValues, icons). This is the previously-unstated prerequisite for localizing Zone 1. Thread the narrow LocaleContext (Decision D6) through, matching the engine's existing convention of passing explicit slices.

Priority:highComplexity:moderateMilestone:v0.29.0Source:SPEC-035

Criteria completion

Criteria completion: 3 of 3 (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.

Scope

  • Add LocaleContext as an argument to buildStructureElement() (packages/transform/src/engine.ts) and to the MetaField / metaFields block renderers (SPEC-080 path).
  • Plumb the slice from the engine entry points down to those call sites; construct it once per render from the resolved ThemeConfig (locale + merged strings).
  • Do not localize any strings yet — this item only makes the context available. Label emission stays literal until WORK-504.
  • Keep the engine framework-agnostic and testable: prefer the narrow slice over the full ThemeConfig. (A bound t() closure is an acceptable equivalent per D6.)

Acceptance Criteria

  • buildStructureElement() and the MetaField block renderers receive a LocaleContext.
  • The context is constructed once per render and threaded, not stored in module-global state.
  • No output change (labels still literal); existing transform/engine tests stay green.

Blocked by

  • WORK-502

References

  • SPEC-035 — Resolution Mechanism (Zone 1), Decision D6.

Resolution

Completed: 2026-07-17

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

What was done

  • createTransform builds a single render-scoped LocaleContext from config.locale + config.strings.
  • Threaded LocaleContext (and the owning RuneConfig, needed for WORK-504 key derivation) into buildStructureElement() (+ its recursive/repeat calls), assembleWithBlocks(), renderBlock, renderBarLayout, renderDefListBlock, renderBlockValue, buildChip, buildLinkValue, buildIconValue.

Notes

  • Pure plumbing — labels remain literal; all 600 transform tests still pass, confirming byte-identical output. WORK-504 consumes the threaded context.