6.0 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.
Validation and exact counts: pending dialog language continuity. Central tracker publication is recorded separately.
Bounded follow-up: translated fallback parameters
Four existing caller families pass application-owned translated labels as primitive parameters: blank custom-section title, default built-in section name, missing company and missing CV name. Resolving only the outer message leaves these fallback labels stale. Use a one-level explicit { key: TranslationKey } parameter alongside existing string/number values; resolve it with the current existing translator before ordinary interpolation. No nested params, recursion, callbacks, reverse lookup or new message engine. I18nProvider/TranslationParams and literal user data stay unchanged.
Reuse the existing twelve-name section mapping once for both normal section labels and dialog metadata, with own-key lookup; unknown/prototype-shaped names remain literal fallbacks. Preserve exact existing || versus ?? behavior, including empty strings and whitespace. Only caller-owned fallback branches construct descriptors; user/job/company/CV/section titles remain literal strings, even if they look like translation keys.
Worker owns only dialogText/dialog-text tests, CvBuilderEditor/deep-link tests, JobTable/jobs-view tests and CvBuilderPage/page tests. Root owns evidence/progress records and serialises checks, commits and graph. This is compatible maintenance under existing delegated technical authority; no new locale/provider/renderer/schema or formal I18N-stage acceptance.
- Reproduce pending fallback-copy cases before source change; retain literal/numeric0/Unicode/markup/no-context behavior.
- Implement the one-level descriptor and four caller families without changing revision, save, cancellation, focus, selection or mutation contracts.
- Run affected suites, non-incremental typecheck/scoped lint, source review, AST refresh and source/native bindings; publish and independently verify refs.
Rollback by reverting only the bounded follow-up source commit(s), retaining unrelated work. Existing Next/build, native/device, human language, final A3, formal European locale, security and release gates remain open.
Completed bounded source0bf0343c, integratedfa5cc1ab, source/native evidence88947a4c published and independently remotely read back. See DIALOG_FALLBACK_PARAMS.md; full European locale/A3/security/release acceptance remains open.