Repository navigation
refactor(ui): replace duplicated locale bundles with canonical translation memory - #117157
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 10:26 PM ET / August 1, 2026, 02:26 UTC. ClawSweeper reviewWhat this changesReplace duplicated non-English Control UI locale bundles with Vite-generated lazy modules materialized from checked-in translation-memory records, and update the locale refresh workflow and verification ownership accordingly. Merge readinessThis PR remains necessary: current main still lazy-loads 20 checked-in foreign locale modules, while the proposed branch moves that catalog materialization to canonical translation memory. The submitted exact-head terminal and Chromium evidence resolves the prior proof-only blocker, but this checkout could not retrieve the PR head for an independent source/diff pass because its promisor remote could not resolve GitHub; the protected Priority: P2 Review scores
Verification
How this fits togetherThe Control UI selects a locale through its registry, which lazy-loads a foreign-language translation catalog after the operator changes language. The PR keeps that user flow but changes the catalog source from large generated TypeScript files to translation-memory data consumed by the Vite build and test pipeline. flowchart LR
A[English Control UI catalog] --> C[Canonical translation memory]
B[Operator selects language] --> D[Locale registry]
C --> E[Vite locale module generator]
D --> E
E --> F[Lazy locale chunk]
F --> G[Translated Control UI]
Decision needed
Why: The change deliberately alters both the Control UI’s runtime catalog representation and the automated generated-output publication boundary; the local review environment could not independently retrieve the submitted head. Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land one canonical translation-memory path only after a refreshed exact-head review confirms the Vite virtual modules, all 20 lazy language selections, failed-chunk retry, and generated-artifact publication still work against current main. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect report: this is a refactor PR. The relevant observable verification is the supplied exact-head Chromium run that selects every registered locale and exercises failed-chunk recovery after Gateway reconnect. Is this the best way to solve the issue? Unclear pending refreshed exact-head source inspection. Consolidating translation data is a plausible owner-boundary improvement, but the new Vite runtime loader and generated-PR workflow must be reviewed together rather than accepted from generated-output claims alone. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7fba71eb7aeb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) test(voice-call): stress paced audio queue drains fix(voice-call): avoid shifting paced audio queues
* commit '7e78de747b8a64d52f30aee948b697bf4c528691': (359 commits) refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) ...
* commit '6938f7dddb63bad59862c014c427d63f0a41a6f4': (368 commits) fix: allow gateway service commands for named profiles (openclaw#116314) fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041) fix(ollama): honor model requests and pull completion contracts (openclaw#117171) fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168) fix(telegram): confirm polling before long poll (openclaw#116970) fix(tlon): wire autoDiscoverChannels through the settings-store round-trip (openclaw#114949) fix(gateway): yield before post-ready background work (openclaw#117083) fix(ui): keep canvas lease renewals lifecycle-owned and timer-safe (openclaw#117173) fix(teams): restore the official square product icon (openclaw#117170) refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) ...
…ation memory (openclaw#117157) * refactor(ui): generate locale bundles from canonical translation memory * fix(ui): keep server-only locale config out of browser test helpers
* commit '5148236bbe050f6c05ee59190986a7215b41ce1c': (359 commits) refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909) fix(slack): let durable ingress retry transient thread lookups (openclaw#117135) refactor(doctor): consolidate shipped state migration ownership (openclaw#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966) fix: guard every migrated session accessor path (openclaw#117140) fix(terminal): measure unicode display width consistently (openclaw#117062) fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123) fix(mistral): reject incomplete streamed tool terminals (openclaw#117137) fix(ai): preserve structured chat content and refusals (openclaw#117136) ...
* commit '55215cd9edd2b585cbaee5481d5352aabf7e4399': (368 commits) fix: allow gateway service commands for named profiles (openclaw#116314) fix(plugins): invalidate bundled artifact locations after metadata refresh (openclaw#117041) fix(ollama): honor model requests and pull completion contracts (openclaw#117171) fix(agents): prevent fallback after stale lifecycle abort (openclaw#117168) fix(telegram): confirm polling before long poll (openclaw#116970) fix(tlon): wire autoDiscoverChannels through the settings-store round-trip (openclaw#114949) fix(gateway): yield before post-ready background work (openclaw#117083) fix(ui): keep canvas lease renewals lifecycle-owned and timer-safe (openclaw#117173) fix(teams): restore the official square product icon (openclaw#117170) refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) refactor(ui): unify filtered session list ownership (openclaw#117158) refactor(agents): consolidate context budgets and compaction recovery (openclaw#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (openclaw#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (openclaw#117150) refactor(reply): unify turn lifecycle state ownership (openclaw#117145) fix(ui): preserve emoji agent avatar initials (openclaw#104912) refactor(auto-reply): unify command and directive ownership (openclaw#117143) refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146) ...
* origin/main: refactor(ui): replace duplicated locale bundles with canonical translation memory (openclaw#117157) fix(ui): retire stale Gateway event-log observers (openclaw#117169) fix(agents): keep subagent status consistent after restart and large fan-outs (openclaw#117141) test(voice-call): stress paced audio queue drains fix(voice-call): avoid shifting paced audio queues
Related: #116386
What Problem This Solves
The Control UI maintained 113,909 lines of duplicate generated foreign-language TypeScript catalogs in addition to translation memory. The catalogs were already stale: every supported language was missing 73 current UI strings, and the strict locale release gate failed.
Why This Change Was Made
Use the existing checked-in translation memory as the single canonical source: group only entries with the same normalized English source and exact translated text, project them into current English key order, and materialize the existing 20 lazy locale modules through Vite virtual modules. Preserve source-owned adapter import paths, owner-scoped tests, the refresh workflow, generated-output isolation, offline retry, and all existing translations. The complete migration has a tightly matched one-time ownership exception; ordinary mixed generated/source changes still fail closed.
User Impact
All 20 Control UI languages remain available, lazy-loaded, and fully translated. Each locale gains 73 previously missing UI translations (1,460 total), retires nine obsolete keys, and preserves every existing translated value. The repository removes 100,119 net lines; handwritten production owner/helper code also shrinks by 9 lines.
Evidence
eea9ef748a0e8d7d4d8e383d1574bcdddf38c01d.1fba7576b70e407c8138d0c2ec9b6d3b6dc27d43.pnpm ui:i18n:verify, strictpnpm ui:i18n:check,pnpm tsgo:ui,pnpm tsgo:scripts,pnpm tsgo:test:ui,pnpm tsgo:test:root, 654 focused owner/workflow/i18n/UI tests, and a full productionpnpm buildwith provider credentials explicitly removed.pnpm ui:buildpasses and emits exactly 20 named lazy locale chunks, totaling 4,758,249 bytes. Startup JavaScript is 303,984 bytes gzip versus the existing 324,587-byte baseline: 20,603 fewer compressed bytes.tbx_01kyxga3bc4ha8bwvr878dcw38: fullpnpm check:changed --base a1b41d5ddb057fe0956b1d53c19fdbf4d33430d9 --head eea9ef748a0e8d7d4d8e383d1574bcdddf38c01dPASSED every lane, including the complete TypeScript project graph, 15,192 core lint files, 8,117 plugin lint files, 877 script lint files, all formatting/dependency/dead-code guards, 248 script declaration contracts, and zero runtime import cycles.tsgo:ui,tsgo:test:ui,tsgo:test:root, focused real oxlint, and both real Chromium locale/offline-retry tests passed.new URL(relative, import.meta.url)to browser HTTP origins in mixed graphs. Resolve filesystem paths from the plugin module before joining the relative path, and dynamically load filesystem-bound Vite configuration only when its Node-owned E2E server actually starts.Exact-head, operator-visible terminal evidence
Refresh-workflow and ownership isolation
test/scripts/ci-workflow-guards.test.tspassed all 93 assertions, including exact per-locale staging of only<locale>.tm.jsonland<locale>.meta.json, generated publication of only translation memory/metadata/fallback baseline, and invalidation on source-owned adapters, English catalogs, canonical loader, sync planner, and workflow owners. Changed-scope tests prove strict i18n remains enabled; ordinary source + generated mixtures still fail closed. The migration-only exception accepts only all 20 exact one-line adapters, all 41 generated artifacts, and the complete canonical-owner change; it cannot match a later unchanged adapter.The initial ClawSweeper comment explicitly reported its own DNS/promisor-fetch outage while reviewing the earlier draft. The exact public branch object is available at eea9ef7; the runner independently checked out and printed that exact SHA. Exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/30679765202
The exact-head real-behavior-proof gate has already passed: https://github.com/openclaw/openclaw/actions/runs/30679764578
One initial hosted browser shard hit an existing unrelated English-only managed-image LRU fixture race at
ui/src/e2e/chat-flow.media-files.e2e.test.ts:629: the unchanged test guesses the evicted image from Blob creation order, while unchangedreadManagedImageBlobUrlcorrectly updates LRU order on each read and revoked a different valid Blob. Git history traces that existing assumption to July 29; this PR changes neither the test nor any managed-media cache/renderer/fixture owner, and the same migration already passed that exact browser shard on the previous commit. All other browser shards, both large shards, the complete UI suite, actual 20-locale browser proof, and the complete exact-head all-lane gate passed. The exact formerly failing real Chromium test was independently rerun on the same exact corrected commit and passed unchanged (1 file / 1 test, 34,407 ms), confirming the pre-existing nondeterministic fixture behavior. Only the failed English-only shard and its dependent aggregate gate were retried once on the unchanged exact commit, without modifying or weakening tests.Latest ClawSweeper rank-up resolution
The completed fresh exact-head ClawSweeper review reports proof sufficient, 5/6, zero actionable findings. The maintainer independently inspected the exact head, locale-loader owner boundary, refresh/generated-only workflow isolation, compatibility behavior, and upstream Vite/Vitest source contracts. The exact merge result was independently verified against current
main7fba71eb7aeb73f6a3b146389e251625efb4fd07:git merge-tree --write-tree origin/main eea9ef748a0e8d7d4d8e383d1574bcdddf38c01dsucceeds conflict-free with merge tree7751a5b6dca31ea2c8a699f36fb754240c181d04. No standalone rebase is needed solely for main drift: repository policy forbids invalidating exact-head CI/proof for that reason, and the maintainer landing flow verifies the final prepared merge result.AI-assisted: implementation, source review, and exhaustive deterministic parity validation.