WORK-510
ID:WORK-510Status:ready

knownSections canonicalSlug + i18nAliases — stable-slug follow-up

knownSections shipped (WORK-024, via SPEC-037) but without the localization shape SPEC-035 called for. slugify() still derives the section wrapper's data-name from raw heading text, so a non-English heading (## Akzeptanzkriterien) produces a different slug than ## Acceptance Criteria, breaking CSS selectors and cross-locale anchors. This item closes that gap. The canonicalSlug half can proceed independently (the framework already exists); the i18nAliases half layers on locale resolution.

Priority:lowComplexity:moderateMilestone:v0.29.0Source:SPEC-035
claude/multi-language-support-spec-5zzt9q View source

Criteria completion

Criteria completion: 0 of 4 (0%) 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/multi-language-support-spec-5zzt9q current ready
main doneclaude/milestone-v0-29-0-stzywk done
History 1
  1. d92ad0c
    Created (ready)by bjornolofandersson

Scope

  • Add canonicalSlug?: string and i18nAliases?: Record<string, string[]> to KnownSectionDefinition (packages/types/src/content-model.ts).
  • buildSections() (plugins/plan/src/util.ts): when a section matches a known section, derive the <section data-name> from canonicalSlug (default slugify(canonicalName)), not the heading text; unrecognised sections keep slugify($heading).
  • matchKnownSection() (packages/runes/src/lib/resolver.ts): consult i18nAliases[locale] in addition to the base alias list when a locale is configured.
  • Tests: a non-English heading matched via i18nAliases yields the canonical, language-stable data-name; unrecognised headings unchanged.

Acceptance Criteria

  • KnownSectionDefinition gains canonicalSlug + i18nAliases.
  • Matched known sections emit a language-independent data-name derived from the canonical key.
  • Locale-specific heading aliases match when locale is set; base aliases still match.
  • Unrecognised sections keep heading-derived slugs (no regression).

References

  • SPEC-035 — Zone 7, Interaction with knownSections.
  • WORK-024, SPEC-037 — the shipped knownSections framework this extends.