feat(i18n): tab auto titles follow the UI language

Titles are stored display text (layout templates, session snapshot,
broadcast registry), so a pane used to keep the wording of the language it
was opened in, and nextTerminalTitle could not even parse the number back
out of another language's pattern (numbering restarted, duplicates).

New pure module src/shared/terminalTitle.ts: resolution tries all four
languages' patterns, rendering uses the active one; i18n gains tFor(lang)
for off-language rendering. Workspace retitles auto-numbered local tabs in
place on language switch, snapshot restore and template apply; SSH panels
(user-typed connection names) are never touched. dockview's title-change
event propagates the new title to the broadcast registry and the snapshot
save with no extra wiring.

New test terminal-title.mjs (16 writer/reader language pairs, non-auto
title boundaries, gap filling); offline suite grows 17 -> 18.
This commit is contained in:
Bill committed 2026-10-08 00:11:20 +08:00
1 parent 9a46555fc1
commit 2653ab1820
9 files changed
+390 -36

No files matched your search

+3
View File
@@ -46,6 +46,9 @@ const BUNDLES = [
// Reserved-accelerator table shared by the settings recorder and main's
// registration guard: pure, table-tested.
{ entry: 'src/shared/reservedAccelerators.ts', out: 'tests/.reserved-accelerators.cjs' },
// Auto terminal-tab titles: the pattern table is shared by the renderer's
// numbering and its language-switch retitle pass. Pure + dictionary-only.
{ entry: 'tests/terminal-title.mjs', out: 'tests/.terminal-title.cjs' },
// Update service: feed probe/fallback. `electron-updater` is aliased to a
// stub (the real package boots Electron), and the shell half (tray.ts) pulls
// a `?asset` import, hence LOADERS.