Skip to content

feat(preset): localize generated instruction files via the declared language#171

Merged
takashi-matsuyama merged 2 commits into
mainfrom
feat/preset-i18n
Jul 13, 2026
Merged

feat(preset): localize generated instruction files via the declared language#171
takashi-matsuyama merged 2 commits into
mainfrom
feat/preset-i18n

Conversation

@takashi-matsuyama

Copy link
Copy Markdown
Member

Summary

Completes the generated-content i18n that v0.33.0 shipped for the four views, extending it to the generated instruction files — the last surface where the author's language leaked into user artifacts (1.0 blocker track).

  • Repo preset block (basou project preset / derive / retrofit): content language follows the repo's own declared language — its audience. ja renders byte-identical to previous releases; en / en+ja / undeclared render English (the new default).
  • View AGENTS.md block & anchor starter: workspace-level artifacts, so they follow the anchor entry's language, mirroring the views' "the workspace speaks the anchor's language" rule.
  • Single locale home: all instruction-file strings move into the core locale table (presetStrings / resolveRepoContentLanguage / resolveAnchorContentLanguage, exported). The language-lint E-5 allowlist shrinks from three files to one (view-strings.ts) — generated Japanese now exists only in the table, enforced by lint.
  • No plumbing added: PresetRepo.language was already an input; resolution is internal. No signature change for renderPresetBlock / renderViewPresetBlock; AnchorStarterRepo gains an optional language field (structurally satisfied by existing call sites).

ja byte identity

  • Captured golden full-text locks from the pre-change output for all three generators (repo block / view block / anchor starter) — embedded as tests, byte-identical under the refactor.
  • Fleet E2E (12 workspaces): all ja surfaces render in sync (zero drift — validated live on takuhon view canonical and nimart repo+view canonicals). The only planned updates are the intended English flips for repos declaring en (e.g. my-favorites greenfield canonicals).

Tests

  • Existing assertions flipped to the English default where fixtures declare en/en+ja/nothing; deliberate ja-path tests kept and extended (ja renders, en+ja→en floor, anchor-only participation).
  • Parameterized-entry sweep extended to both preset tables (coverage gate).
  • core 1337 / cli 984 / sdk 18 pass with coverage gate; lint + lang-lint clean.

🤖 Generated with Claude Code

takashi-matsuyama and others added 2 commits July 14, 2026 00:25
…anguage

Completes the i18n pass v0.33.0 started for the views. A repo's preset
block follows the repo's OWN declared language (its audience); the view
block and the anchor starter follow the ANCHOR entry's language,
mirroring the views' rule. ja renders byte-identical to previous
releases (locked by full-text goldens); en / en+ja / undeclared render
English, the new default. All instruction-file strings move into the
single core locale table, shrinking the language-lint E-5 allowlist
from three files to one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- A1: correct the CHANGELOG migration note: language-resolution drift
  surfaces via preset/derive update plans; project check inspects wiring
  structure, not generated-region content
- A2: document the caller-set anchor flag vs the views' path-dot anchor
  predicate (and first-wins ordering) on resolveAnchorContentLanguage,
  with a first-wins test
- A3: retitle spec 10.0 to cover generated content broadly, sub-head the
  instruction-file rule, drop the duplicated undeclared case
- A4: note the table-selection invariant that makes some source-language
  label branches unreachable from renders

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@takashi-matsuyama
takashi-matsuyama merged commit 7ca71e8 into main Jul 13, 2026
7 checks passed
@takashi-matsuyama
takashi-matsuyama deleted the feat/preset-i18n branch July 13, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant