3.6 KiB
Live dialog text implementation plan
For agentic workers: implement through the existing direct-chat subagent workflow, with explicit file ownership and test-first verification. No backlog controller or replacement runner is involved.
Goal: keep opted-in EN/NB confirmation and prompt copy current when language changes, preserving pending actions, literal data and drafts.
Architecture: use an optional { key, params } representation alongside existing literal strings. Resolve it during provider rendering through the existing TranslationKey, catalogue and interpolation. This is the implementation team's delegated compatibility choice; formal I18N stage and locale-publication acceptance remain open.
Tech stack: existing React/TypeScript, MUI, I18nProvider and Jest. No new dependencies or configuration.
Spec: owner continuous directive; E:/Storage/Projects/Active/temp docs/final/I18N/03_I18N_02_FRONTEND_UI.md tasks2,3,6; master stage/publication gates remain. Root's read-only source review confirmed no mandatory separate approval for bounded compatible EN/NB maintenance.
Contract and file ownership
src/dialogText.ts:DialogText = string | { key: TranslationKey; params?: TranslationParams }; one shared resolver. Literal strings, including empty strings and key-looking user data, remain verbatim. Optional metadata uses currentt; absent I18n context uses the English catalogue and the existing interpolation function.src/i18n/I18nProvider.tsx: export existing interpolation/parameter types for reuse; preserve their implementation and UI/job/generated-content language separation.src/confirm.tsx,src/prompt.tsx,src/dialogs.ts: widen only message/title/action-label inputs to DialogText and resolve at render. Preserve omitted defaults, promise types, focus/IDs, destructive flags, Escape/backdrop behaviour, prompt input/selection, max length and legacy callers. No reverse lookup of translated strings.- First caller: only Correspondence's existing delete confirmation message/title/confirm label. Values and current-job guards remain unchanged. Other caller migrations are separate maintenance packages.
- Root owns Correspondence and its test; worker owns shared provider/type/resolver files and provider tests. Neither changes the other's scope or Git index. Root serialises source integration, checks and graph updates.
Execution and verification
- Add EN→NB and NB→EN regressions for an already-open real correspondence confirmation; reproduce old snapshot text before implementation.
- Add contract tests covering literals/empty strings, opted-in labels/message, variable0/Unicode/plain-text escaping, missing context English fallback, pending resolver, prompt draft/focus and one accept/cancel result.
- Implement the smallest shared resolver and optional types, then migrate the one caller family. Avoid new engines, render callbacks or automatic translation of literal input.
- Run provider/modal/flow and affected correspondence tests; run TypeScript and scoped lint. Preserve failed/intermediate native receipts and distinguish overlapping reruns.
- Review source/data/callers, update AST graph, bind exact source/native evidence, commit/publish/ref-readback and update the authoritative TODO/status/checkpoint.
Current Next build remains FAILED pending advisory qualification. This package cannot claim fresh browser/device/native-language, full I18N/A3 or release acceptance. Roll back by reverting only this package's source commits on the development branch, preserving unrelated work; no database/data migration is involved.