Skip to content

i18n: multilingual mdbase writer (9 locales) - #35

Merged
callumalpass merged 100 commits into
mainfrom
feat/i18n
Oct 26, 2026
Merged

callumalpass merged 100 commits into
mainfrom
feat/i18n

Conversation

@callumalpass

@callumalpass callumalpass commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Status — draft; residual scroll regression fixed, current-head CI green

Head: b353683b092aae176bd83f703133ab8990c7b784 (feat/i18n).

Summary

  • Lingui interface/accessibility catalogues: synchronous English plus lazy same-deployment fr/de/es/ja/ko/pt-BR/ru/zh; negotiated/persisted language controls. 658 active IDs per locale; all eight authored writer-v2 heads merged.
  • Both final a36fa009 shared kit/UI pins adopted and SHA256 verified; frozen lock refreshed, superseded tarballs removed. All nine shared UI catalogues have197 IDs/no obsolete nzHlj8. One real Lingui singleton; strict all-nine check --compose, completeness/contracts and source guard in normal checks/builds/CI. No translator mocks or silent duplicate overrides.
  • Manuscript/exported prose, citation language, user data/paths and raw authority/Typst diagnostics remain untranslated. Worker diagnostics translate only at the presentation boundary.

Residual scroll root cause and fix

This was introduced by i18n, not reproduced on main. WorkspaceView uses <Editor key={active}>, so chapter switches remount it. The previous fix cached phrases only in instance refs: every target-language remount reset them to English. Even warm imports then delivered an asynchronous language/chapter/live-preview decoration refresh during CodeMirror's retained-scroll measurement. The previous unit test only rerendered one instance and missed the real lifetime.

Resolved dictionaries now live outside the keyed component lifetime. Remounts install cached active phrases synchronously, without a deferred redraw. Actual language changes still reconfigure the view in place; stale callbacks are cancelled. No restore retries, artificial delays, relaxed thresholds, skipped assertions or browser-test edits.

Controlled identical original scroll/history/selection scenario, fresh1500×950 contexts, ten iterations each en/ja/de:

  • Separate fetched origin/main worktree at 4c853dc: 30/30 PASS (main UI English, browser locales varied).
  • Previous head b9b79e3: en 10/10 PASS, ja/de 20/20 FAIL, paragraph83→91.
  • Fixed source: 30/30 PASS with geometry observations, plus 30/30 PASS using the original uninstrumented locale probe: 60/60, no failed iterations retried.
  • Width611px/content574px/height864px stay unchanged through restore. This is not translated chrome resizing or a user locale switch.
  • Strengthened real-runtime en/ja/de unit regression uses keyed remounts, exact translated accessible names, synchronous phrases and absence of deferred dispatch before measurement. RED ja/de before fix, GREEN after.

Verification

  • rpnpm check: PASS, including final full check after strengthening the exact-name assertion (all-nine composition/contracts, source guard87, typecheck, full tests).
  • Separate rpnpm test: PASS. 689 passes / seven existing skips: core65; Writer321 Vitest +77 Node; root226.
  • rpnpm build:production: PASS.
  • rpnpm --filter @mdbase-writer/app build:editing-test: PASS. Both reach Vite; existing non-fatal chunk/plugin timing warnings.
  • Unchanged full reliability suite: PASS.
  • Full i18n browser suite: PASS after correcting local headless environment, with every screenshot/assertion intact. Initial screenshot failures retained: DEBUG traced ANGLE xcb_connect/GPU init failure to stale inherited DISPLAY=:0. env -u DISPLAY -u WAYLAND_DISPLAY node scripts/i18n-browser-test.mjs passes unchanged, with no GPU errors. Japanese editor/German narrow-settings screenshots inspected.
  • Baseline/editing/feedback browser suites not rerun locally in this follow-up; demo acceptance is not production export/native-device qualification.
  • Additional reruns against exact committed head b353683: separate rpnpm test, production build and editing-test build all PASS. Logs /tmp/writer-scroll-head-{test,production,editing}.log.
  • Evidence/details: docs/translations.md; /tmp/writer-scroll-{main,feature,fixed}-30.log, fixed-original-30.log, regression-{red,green}.log, {check-final,check-exact-label,test,production,editing,reliability}.log, i18n-browser{,-diagnostic,-headless}.log. Screenshots/video ignored under apps/writer/out/i18n/.

GitHub CI

Current head b353683: run39973553313 SUCCESS / 16m11s, exact SHA verified with gh pr view and gh pr checks 35. Catalogue validation, full check/build, production editing, baseline/reliability/i18n browser stages and private-feedback stage passed. Package installation accounted for ~10 minutes of the run. No remaining observed scroll blocker.
Previous head b9b79e3 PASS7m45s: run39971283306, whose English-only reliability test missed the target-locale stress bug.
Earlier head9c86d59 FAILED scroll retention: run39964546081.

Required before merge

  • Current-head GitHub CI is green. PR remains draft for the coordinated published-package handoff below; no remaining scroll-retention blocker.
  • Replace BOTH vendored kit/UI dependencies with published npm versions after the coordinated Connect release; refresh the lock and rerun all gates against those exact bytes.
  • Kit SHA256: da2ae8145e5744733c29726a5b56f999c19f82bdd9d48c57d67da29cc18dd9b5.
  • UI SHA256: e7199463d7f4d282cfd6f5f16e71dc1aa1029330a634f43112ae5b2f63dea7a0.
  • No publication, deployment, tag, main merge, native-device acceptance or independent native-speaker certification performed.

# Conflicts:
#	apps/writer/src/i18n/locales/ko/messages.po
# Conflicts:
#	apps/writer/src/i18n/locales/es/messages.po
# Conflicts:
#	apps/writer/src/i18n/locales/zh/messages.po
# Conflicts:
#	apps/writer/src/i18n/locales/de/messages.po
# Conflicts:
#	apps/writer/src/i18n/locales/ko/messages.po
# Conflicts:
#	apps/writer/src/i18n/locales/ru/messages.po
@callumalpass
callumalpass marked this pull request as ready for review October 26, 2026 09:21
@callumalpass
callumalpass merged commit ce4baab into main Oct 26, 2026
1 check passed
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