WORK-506
ID:WORK-506Status:ready

refrakt i18n extract command (+ --check + MCP)

Auto-derived keys (Decision D1) are only usable if authors and translators can discover them, so this command is the load-bearing mitigation, not a convenience. It emits the full derivable key set with English defaults as a JSON dictionary — the same shape as translation files (Decision D3), so extract → translate → commit <locale>.json round-trips.

Priority:highComplexity: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

  • refrakt i18n extract — walk every rune's structure / metaFields (reuse the contracts machinery) and emit key → English default as JSON to stdout / -o.
  • Include core, layout, computed, enum, and per-plugin keys; only structured/JSON output (makes the MCP wrapper thin).
  • --check mode (mirroring contracts --check) — fail CI on a new labelled field with no dictionary entry or an orphaned key after a rename; report per-locale coverage (e.g. de: 94%).
  • Expose as an MCP tool following the refrakt.contracts precedent. Detailed input schema is deferred to implementation.

Acceptance Criteria

  • refrakt i18n extract emits a complete key → English default JSON dictionary covering core + all loaded plugins.
  • --check fails on missing/orphaned keys and prints per-locale coverage.
  • Extract output shape matches the translation-file format consumed by ThemeConfig.strings / Plugin.translations.
  • The command is registered as an MCP tool.

Blocked by

  • WORK-504

References

  • SPEC-035 — Tooling section, Decisions D1/D3.