Skip to content

fix(ui): bootstrap source-only locales - #131015

Merged
obviyus merged 1 commit into
mainfrom
codex/issue-130070
Aug 27, 2026
Merged

obviyus merged 1 commit into
mainfrom
codex/issue-130070

Conversation

@obviyus

@obviyus obviyus commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #130070

Reported by @TheAngryPit.

What Problem This Solves

Fixes an issue where contributors adding a Control UI locale could not load or test it before the post-merge translation workflow created its generated translation memory.

Why This Change Was Made

The Vite locale materializer now serves the complete English source catalog only while a registered locale's generated memory file is absent. Existing empty, malformed, or stale generated output remains subject to the strict validation path.

The locale refresh workflow now derives its matrix from the canonical locale configuration. The runtime locale list is also derived from its loader registry instead of repeating every locale.

User Impact

Contributors can submit the documented source-only locale wiring, see and select that locale in the Control UI, and rely on the post-merge workflow to target it automatically.

Evidence

  • On main 8e4075371039, a source-only Swedish fixture passed pnpm ui:i18n:verify, then failed registry and Vite loading with Control UI sv translation memory is missing or empty.
  • With head 12830260249, the identical fixture passed all 41 registry tests, appeared in the derived refresh target set, and loaded in the real Vite Control UI with html.lang set to sv and English bootstrap copy visible.
  • pnpm ui:i18n:check rejected a present malformed fixture memory file with a JSON parse error.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/app/vite-config.node.test.ts ui/src/i18n/lib/registry.test.ts — 63 passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling-isolated.config.ts --configLoader runner test/scripts/control-ui-i18n.test.ts — 21 passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts --configLoader runner test/scripts/ci-workflow-guards.test.ts -t "keeps locale refresh matrices alive" — passed.
  • pnpm ui:i18n:verify, pnpm check:script-erasability, focused Oxlint, formatting, and conflict-marker checks passed.
  • JSON-only locale config changes select both pull-request and local Control UI localization checks; 164 focused routing tests passed.

Visual proof

Before After
Missing locale memory blocks the selected locale Source-only Swedish locale stays selected with English bootstrap copy

AI-assisted. I reviewed the code and understand the source/generated ownership boundary.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts labels Aug 27, 2026
@obviyus
obviyus marked this pull request as ready for review August 27, 2026 16:11
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 27, 2026
@obviyus
obviyus force-pushed the codex/issue-130070 branch 2 times, most recently from d7c3965 to 552ec9d Compare August 27, 2026 16:22
@obviyus
obviyus force-pushed the codex/issue-130070 branch from 552ec9d to 1283026 Compare August 27, 2026 16:49
@obviyus

obviyus commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @TheAngryPit!

Proof: On exact head 12830260249, a source-only Swedish locale with no generated translation memory passed contributor verification, loaded through the real Vite Control UI, stayed selected with html.lang=sv, and appeared in the canonical refresh target set. A present malformed memory file still failed strict validation. Exact-head openclaw/ci-gate and the local ClawSweeper review passed.

  • Bug: Selecting a newly registered source-only locale failed before the post-merge translation workflow could generate its memory.
  • Fix: Missing memory now loads intentional English bootstrap copy, while canonical locale data drives refresh targets and present invalid memory remains fatal.

Example

Before After
Selecting Swedish shows translation memory is missing or empty. Swedish stays selected with English copy until the generated translation refresh lands.

@obviyus
obviyus merged commit c85be96 into main Aug 27, 2026
143 checks passed
@obviyus
obviyus deleted the codex/issue-130070 branch August 27, 2026 17:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
Allow source-only locale contributions to load intentional English bootstrap copy until post-merge generated memory exists. Derive refresh targets from canonical locale data while preserving strict validation.

Co-authored-by: Ayaan Zaidi <[email protected]>
jcorrius added a commit to jcorrius/openclaw that referenced this pull request Oct 2, 2026
…k invariants

The shipped-locale invariants in translate.test.ts started deriving their
locale sweep from SUPPORTED_LOCALES (openclaw#159292), which accidentally broke the
source-only locale flow from openclaw#131015: a locale registered before the
post-merge control-ui-locale-refresh workflow commits its translation
memory intentionally bootstraps from English copy, so the three
"localized in shipped locale bundles" tests fail for it.

Hold only locales with committed <locale>.tm.jsonl memory to those
invariants. The exemption derives from the memory file's presence, so it
retires itself once the refresh workflow lands translations and cannot
hide a regression for any memory-backed locale.

Unblocks the Catalan locale PR (openclaw#139033).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control UI cannot bootstrap a newly registered locale

2 participants