Skip to content

feat(i18n): LanguageTool registry metadata + Phase-0 report (Workstream B)#234

Merged
qnbs merged 1 commit into
mainfrom
feat/i18n-lt-registry-phase0
Jun 24, 2026
Merged

feat(i18n): LanguageTool registry metadata + Phase-0 report (Workstream B)#234
qnbs merged 1 commit into
mainfrom
feat/i18n-lt-registry-phase0

Conversation

@qnbs

@qnbs qnbs commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

First PR of the i18n hardening + real LanguageTool program (plan addition). This is Phase-0 + Workstream B — read-only ground truth + the low-risk registry enrichment that the editor grammar feature will gate on. No user-facing behavior changes yet.

What's in here

  • i18n/locales.ts — every one of the 19 locales gains languageToolSupport (strong | partial | none) + languageToolCode, plus SSOT helpers getLanguageToolCode() / hasLanguageToolSupport(). Verified against dev.languagetool.org/languages (2026-06-24).
  • docs/i18n/ADAPTIVE_CURRENT_STATE_REPORT_v3.md — the mandatory Phase-0 report: locale inventory + tiers, the LanguageTool scaffold reality, the editor textarea+overlay seam, existing docs/tooling to extend, the verified LT support matrix, adjusted prioritization, and risks.
  • docs/i18n/TRANSLATION_STATUS.md — seeds an append-only Review & Elevation Log (no tier promoted; data-gated).
  • tests/unit/i18n/localesRegistry.test.ts — extended: valid LT tier per locale, languageToolCode present iff supported, unsupported locales pinned to none, core-5 have coverage.

⚠ Material correction to the plan

The plan claimed "pl/nl/tr/uk/ro all have strong LanguageTool coverage." Turkish is not supported by LanguageTool at all (absent from its language list), as are he/fi/hu/is/eu/ko. These get languageToolSupport: 'none' and the grammar feature will be simply absent for them — no false promise. Of the 5 new locales: pl/nl/uk = strong, ro = partial, tr = none (tr stays for its UI-locale value).

Test plan

  • pnpm run lint ✅ (1611 files)
  • pnpm run typecheck
  • pnpm run i18n:check ✅ (no parity drift; bundles rebuild identically)
  • pnpm exec vitest run tests/unit/i18n/localesRegistry.test.ts ✅ (14 tests)

Next in the stack

PR-C1 (languageToolService + "Check this scene" MVP), then PR-C2 (live inline overlay), then one stacked PR per new locale (pl/nl/tr/uk/ro).

🤖 Generated with Claude Code

…am B)

Enrich the locale SSOT (i18n/locales.ts) with verified LanguageTool coverage:
languageToolSupport (strong|partial|none) + languageToolCode on all 19 locales,
plus getLanguageToolCode()/hasLanguageToolSupport() helpers so the upcoming
editor grammar feature gates on one source. Data verified against
dev.languagetool.org/languages (2026-06-24).

Key correction to the program plan: Turkish has NO LanguageTool support (absent
from LT's language list), as do he/fi/hu/is/eu/ko — these get 'none' and the
grammar feature is simply absent, no false promise. Of the 5 new locales,
pl/nl/uk=strong, ro=partial, tr=none.

Adds the mandatory Phase-0 Adaptive Current-State Report and seeds an append-only
Review & Elevation Log in TRANSLATION_STATUS.md (no tier promoted — data-gated).
Registry-integrity test extended (code present iff supported; unsupported pinned).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldscript-studio Ready Ready Preview, Comment Jun 24, 2026 7:22pm

@deepsource-io

deepsource-io Bot commented Jun 24, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in ae7ee43...166b547 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Docker Jun 24, 2026 7:21p.m. Review ↗
JavaScript Jun 24, 2026 7:21p.m. Review ↗
CSS Jun 24, 2026 7:21p.m. Review ↗
Rust Jun 24, 2026 7:21p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@qnbs qnbs merged commit 37be659 into main Jun 24, 2026
22 checks passed
@qnbs qnbs deleted the feat/i18n-lt-registry-phase0 branch June 24, 2026 19:43
qnbs added a commit that referenced this pull request Jun 24, 2026
…fe apply) (#235)

* feat(languagetool): real grammar-check service (checkText + offset-safe apply)

The foundation for the editor grammar feature, beyond the connectivity ping in
languageToolClient.ts. checkText() POSTs /v2/check, parses matches[] into a
normalized shape (offset/length/message/replacements/rule/category), slices the
flagged span from the source for reliable display + dictionary matching, caches
by text hash (dictionary applied post-cache so a new word never re-fetches), is
abortable, and degrades silently to an empty result on any network/HTTP failure.
applyMatchReplacement() applies one suggestion offset-safe with an anchor check
so stale offsets can never corrupt the text. Privacy-first: never logs manuscript
text. Locale gating uses getLanguageToolCode() from the SSOT (PR #234).

13 tests cover parsing, empty-text short-circuit, caching, dictionary filtering
(spelling-only), replacement cap, out-of-range drop, offline/error degradation,
abort rethrow, and offset-safe apply. Gating is covered by languageToolClient.test.

Stacked: the 'Check this scene' panel + hook + i18n land in the next PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(languagetool): rename short locals/params (DeepSource JS-C1002)

Touching a new file surfaces its short-identifier names as introduced anti-patterns.
Rename c→code, r→rep, s→val, w→word, m→raw/match to clear JS-C1002 (keep the
conventional loop index i). No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test(languagetool): rename short const in test (DeepSource JS-C1002)

DeepSource analyzes tests/unit/ too; JS-C1002 flags const/let declarations.
Rename const m → firstMatch. No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
qnbs added a commit that referenced this pull request Jun 25, 2026
* docs(languagetool): feature guide + ADR 0010 + CHANGELOG + README

Document the shipped LanguageTool integration (registry metadata #234, service
#235, on-demand panel #236, live inline overlay #238): docs/LANGUAGETOOL.md
(setup, privacy model, locale coverage, architecture), ADR 0010 (self-hosted +
overlay-reuse + locale-mapping rationale), CHANGELOG [Unreleased] entry, README
feature line + Documentation Hub row. Locale-addition rollout (pl/nl/tr/uk/ro)
is tracked separately and intentionally not covered here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(i18n): dedicated TODO for the LanguageTool new-locale rollout (deferred)

Self-contained plan for the remaining program tail — adding pl/nl/tr/uk/ro UI
locales (per-locale recipe, LT metadata, sequencing, gotchas) + the
locale-dependent closing docs (README 19→24, handover report). Deferred for
later execution after other planned work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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