M1.11: English message catalog for every UI string
ui/src/i18n: en.json (20 flat dotted keys) and t(key, params?) with
{name} interpolation; a missing key warns in dev and returns the key.
All template text, title/aria-label attributes, notices and frontend
error texts go through t. ESLint vue/no-bare-strings-in-template is an
error. Catalog tests: interpolation, missing key, every t() key exists,
no unused keys. Engine messages stay English (G14). Docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
851d438e2a
commit
7c0fb312f6
21 changed files with 273 additions and 37 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Architecture
|
||||
|
||||
> **Status:** M0 decisions recorded, M1 workspace, desktop bridge, tabs and editor documented · **Last updated:** 2026-10-15
|
||||
> **Status:** M0 decisions recorded, M1 workspace, desktop bridge, tabs, editor and message catalog documented · **Last updated:** 2026-10-15
|
||||
|
||||
## Overview
|
||||
|
||||
|
|
@ -101,6 +101,13 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
|
|||
- Closing a dirty tab asks Save / Don't Save / Cancel; `buffer.close` without `force` failing with `unsaved_changes` also leads to the question. Lutra saves only on request for now (no autosave).
|
||||
- Theme: the editor reads colours only from `--lt-*` tokens. Tokens the theme does not have yet are read as `var(--lt-new-token, <fallback from existing tokens>)` so they take effect once added in Rust.
|
||||
|
||||
### Message catalog (M1.11)
|
||||
|
||||
- Every interface string comes from `ui/src/i18n/en.json`: flat dotted keys grouped by area (`app.*`, `project.*`, `editor.*`, `common.*`), kept sorted. Components and stores call `t(key, params?)` from `ui/src/i18n`; `{name}` placeholders are filled from `params`, a placeholder without a value stays as it is. A missing key returns the key itself and warns on the console in development builds; it never throws. `hasMessage(key)` tells whether a key exists, for keys that arrive at runtime (settings `labelKey`, notification `messageKey`).
|
||||
- No i18n dependency: the helper is ~20 lines, and plurals, a reactive locale and a second language are G14 work. `vue-i18n` (MIT) remains an option then.
|
||||
- Enforcement: ESLint `vue/no-bare-strings-in-template` is an error (bare text and `title`/`aria-label`/`placeholder`/`alt` attributes); the allowlist is the rule's punctuation plus `;`, `…` and `×`. The test `ui/tests/i18n/catalog.test.ts` scans `ui/src` for `t("…")` calls and fails on a key that is not in `en.json` and on a catalog key that no source uses. Keys used only at runtime need an exception there when they arrive.
|
||||
- Engine messages (`EngineError.message`, the `app.about` slogan, `watchFailed`) are English text from the engine and shown as they are; they move to message keys with G14. Frontend-made errors (`unexpected result of …`) use the catalog.
|
||||
|
||||
## Decisions (M0)
|
||||
|
||||
| Question | Decision | Why |
|
||||
|
|
@ -118,6 +125,7 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-15 | minor | M1.11: message catalog (`t`, lint rule, catalog test, engine messages stay English) |
|
||||
| 2026-10-15 | minor | M1.6: tabs and editor (buffer sync, CRLF offsets, shortcuts from command specs) |
|
||||
| 2026-10-15 | minor | M1.4: desktop bridge (engine://event, engine_ready replay, folder picker, capabilities), UI contract fix |
|
||||
| 2026-10-14 | minor | M1.3: workspace commands, edit protocol, events, events.subscribe, watched-directory limits |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Gaps
|
||||
|
||||
> **Status:** M0 closed G1; G2 under way (text buffer, engine buffers, tabs and editor in the app); G3 project tree works in the app · **Last updated:** 2026-10-15
|
||||
> **Status:** M0 closed G1; G2 under way (text buffer, engine buffers, tabs and editor in the app); G3 project tree works in the app; G14 English UI catalog in place · **Last updated:** 2026-10-15
|
||||
|
||||
Every known shortfall, ranked. This is the work list: unless the owner gives a task, take the highest open gap. Hours are agent wall-clock hours for one agent, all estimated.
|
||||
|
||||
|
|
@ -19,12 +19,14 @@ Every known shortfall, ranked. This is the work list: unless the owner gives a t
|
|||
| G11 | Stability: crash-free operation on real projects and machines | ongoing | ~100 h |
|
||||
| G12 | Performance budgets: start, open, type, search, index | ongoing | ~100 h |
|
||||
| G13 | Frameworks: Symfony, Laravel, Shopware, WordPress | M6 | ~300 h |
|
||||
| G14 | Localization: English and German interface | later | ~40 h |
|
||||
| G14 | Localization: English and German interface: ~~English message catalog for UI strings~~ (M1.11), engine messages (`EngineError.message`) as message keys, language switch, plurals, German catalog | later | ~38 h |
|
||||
| G15 | Database tools, HTTP client, Docker and remote | later | ~430 h |
|
||||
| G16 | Plug-ins and ecosystem | later | ~120 h |
|
||||
|
||||
G2 progress: the engine text buffer landed (M1.1, `crates/text`: rope, UTF-16 and char positions, atomic edit batches, line ending policy). M1.3 added engine buffers with versions, the edit protocol, save and save all, and reloading on external changes. M1.6 added tabs and a CodeMirror 6 editor synced to engine buffers (version-based edits with resync, CRLF-aware offsets), save and save all by engine shortcuts, the Save / Don't Save / Cancel question and a notice for files changed on disk. Still open: the recovery journal, tab management beyond open/close, a conflict UI (compare and merge with the disk version), autosave, editor settings (font size, soft wrap); estimate lowered to ~18 h.
|
||||
|
||||
G14 progress: M1.11 moved every UI string in `ui/src` into the English catalog `ui/src/i18n/en.json` behind `t(key, params?)`, enforced by `vue/no-bare-strings-in-template` and a catalog test. Messages the engine sends (`EngineError.message`, the slogan from `app.about`) are still English text; they need message keys with params before a second language can cover them.
|
||||
|
||||
Known smaller items from M0:
|
||||
|
||||
- The CI workflow has never run: the repository has no remote until the owner decides on hosting.
|
||||
|
|
@ -35,6 +37,7 @@ Known smaller items from M0:
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-15 | minor | G14 note: English message catalog (M1.11) |
|
||||
| 2026-10-15 | minor | G2 shrunk: tabs and editor (M1.6) |
|
||||
| 2026-10-15 | minor | G3 shrunk: project tree wired to the engine (M1.4) |
|
||||
| 2026-10-14 | minor | G2 shrunk, G3 note: engine workspace (M1.3) |
|
||||
|
|
|
|||
|
|
@ -1,16 +1,29 @@
|
|||
# Localization checklist
|
||||
|
||||
> **Status:** baseline · **Last updated:** 2026-10-13
|
||||
> **Status:** English catalog covers 100% of UI strings (M1.11); German not started · **Last updated:** 2026-10-15
|
||||
|
||||
| Language | Code | Status | Translated |
|
||||
|---|---|---|---:|
|
||||
| English | `en` | source | 0% |
|
||||
| German | `de` | planned | 0% |
|
||||
| English | `en` | source catalog (`ui/src/i18n/en.json`) | 100% of UI strings (20 keys, measured by the catalog test) |
|
||||
| German | `de` | planned (G14) | 0% |
|
||||
|
||||
All interface strings go through the message catalog from the first UI task on; no hard-coded labels.
|
||||
All interface strings go through the message catalog: `t(key, params?)` from `ui/src/i18n`, flat dotted keys grouped by area (`app.*`, `project.*`, `editor.*`, `common.*`), `{name}` placeholders. Lint (`vue/no-bare-strings-in-template`, error) rejects bare text in templates; a Vitest scan checks that every key passed to `t` exists in `en.json` and that the catalog has no unused keys.
|
||||
|
||||
## Checklist
|
||||
|
||||
- [x] English message catalog and `t` helper (M1.11)
|
||||
- [x] Lint rule against bare template strings (M1.11)
|
||||
- [x] Every UI string in `ui/src` from the catalog: templates, `title` and `aria-label` attributes, notices, frontend error texts (M1.11)
|
||||
- [ ] Engine messages: `EngineError.message` and other texts the engine sends are English only; they need message keys and params (G14)
|
||||
- [ ] Setting labels and descriptions from `settings.list` (`labelKey`, `descriptionKey`) in the catalog (M1.9b)
|
||||
- [ ] Language switch through `ui.language`; the catalog becomes reactive (G14)
|
||||
- [ ] Plural forms and number/date formatting per locale (G14)
|
||||
- [ ] German catalog (G14)
|
||||
- [ ] Native menus and dialogs of the desktop shell (folder picker title, app menu) (G14)
|
||||
|
||||
## Revision history
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-15 | minor | M1.11: English catalog, lint rule, checklist; engine-message gap |
|
||||
| 2026-10-13 | major | Baseline |
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Hours are agent wall-clock hours for one agent; M0 and M1 so far are measured, t
|
|||
| Milestone | Goal | State | Hours |
|
||||
|---|---|---|---:|
|
||||
| M0 | Foundation: workspace, lints, quality gate, command registry, control channel, empty window | done 2026-10-14 (CI workflow written, not yet run: hosted on Forgejo, runners unknown) | ~2 (measured) |
|
||||
| M1 | Editor and project: open folder, tree, tabs, editor, save, recovery, palette, settings, themes | in progress (M1.1 text, M1.2 VFS, M1.5 tree UI, M1.3 engine workspace, M1.4 desktop bridge, M1.6 tabs and editor) | ~6 (2.5 measured for M1.1–M1.6) |
|
||||
| M1 | Editor and project: open folder, tree, tabs, editor, save, recovery, palette, settings, themes | in progress (M1.1 text, M1.2 VFS, M1.5 tree UI, M1.3 engine workspace, M1.4 desktop bridge, M1.6 tabs and editor, M1.11 message catalog) | ~6 (2.5 measured for M1.1–M1.6) |
|
||||
| M2 | Syntax and search: highlighting, structure, find in files, go to file/class/symbol | not started | ~5 |
|
||||
| M3 | LSP, terminal, CLI: completion, diagnostics, go to definition, hover, rename; terminal; `lutra` CLI and MCP — **MVP** | not started | ~8 |
|
||||
| M4 | Git: status, diff, commit, branches, log, blame, conflicts | not started | ~150 |
|
||||
|
|
@ -31,6 +31,7 @@ By the raw estimates the alpha gate needs M1–M4 plus cross-platform verificati
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-15 | minor | M1.11 message catalog |
|
||||
| 2026-10-15 | minor | Cycle C1 review: M1–M3 hours recalibrated ×0.1, M0 CI note |
|
||||
| 2026-10-15 | minor | M1.6 tabs and editor |
|
||||
| 2026-10-15 | minor | M1.4 desktop bridge |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue