Repository navigation
feat(i18n): add Swedish to the Control UI and docs - #62063
Conversation
Greptile SummaryThis PR adds Swedish (
Confidence Score: 4/5One P1 logic bug prevents auto-detection of Swedish browser users; otherwise the change is well-structured and complete. Score is 4 because a single missing one-liner in resolveNavigatorLocale means the primary auto-detection path for Swedish users silently falls back to English, which is a present defect in the changed code. ui/src/i18n/lib/registry.ts — missing startsWith('sv') branch in resolveNavigatorLocale
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efea95236b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
0cd35b9 to
2db4baf
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR registers Swedish in the Control UI and docs pipeline, with English UI fallback until generated translations arrive. Example: Open Settings → Appearance with browser language sv-SE and no saved language.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful, has maintainer-supported direction, and introduces no identified defect at the reviewed head; exact-head CI is still pending. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe locale registry resolves browser and saved languages into lazy UI catalogs; the docs publisher combines canonical English routes with Swedish navigation labels and translation rules. flowchart TD
A[Browser or saved language] --> B[Locale registry]
B --> C[Lazy catalog materializer]
C --> D[Control UI language picker]
E[English docs and Swedish labels] --> F[Docs sync and translator]
F --> G[Docs publisher]
Technical reviewBest possible solution: Land the source-only Swedish wiring through normal gates and let the established translation workflows generate the catalogs and docs pages. Do we have a high-confidence way to reproduce the issue? Current-main source confirms Swedish is absent; inspected browser comparison images show the missing option before and its presence after, without executing target code during this review. Is this the best way to solve the issue? The change uses existing locale, catalog, and docs owners, preserves preference handling, and keeps generated translations in their established post-merge workflow. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 58c0073dff09. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +7, Tests +120, Docs +1898, Other +6. Total +2031 across 15 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (29 earlier review cycles; latest 8 shown)
Reviewed October 14, 2026, 10:24 AM ET / 14:24 UTC (Revision 30). |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Brave Diff Drake Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
2db4baf to
cd3be8c
Compare
|
Updated this PR with the Swedish merge-blocker cleanup. What changed:
Verification run locally:
Commit pushed: |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Hi, just checking in on this PR. Do you have an update on its status or the maintainer review timeline? Thanks! |
|
Hi @yeager, thanks for staging Swedish. Since #131015 (27 August), main can register a source-only locale that serves the English bootstrap copy until the post-merge refresh writes its translations, so the I have that change on a branch against today's main: https://github.com/jonathanlindsay/openclaw/tree/feat/control-ui-sv (one commit, 7 files, +12/-6, no generated files). On it, Would you like to take it into this PR, or should I open it as a separate PR that supersedes this one? Either is fine with me. Our first users are Swedish, so we will read the generated Swedish after each release and send any terminology fixes as small PRs. |
|
The intended rollout is now recorded in the PR body: generate and review the Swedish catalog first, then activate |
|
The branch is now rebuilt on current |
|
Tack, @jonathanlindsay. Din source-only-lösning är nu inarbetad i den här PR:n ovanpå aktuell |
Baseline-Refresh: c8b4ef824d3db767f9a21396cc05a45008bc43fa
|
@clawsweeper re-review Rebased and corrected at |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
Baseline-Refresh: 437e35bf0f39ac3100e0fadb7a13aa7733ebb504
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
Swedish-speaking operators cannot select Swedish in the Control UI, and Swedish is missing from the docs translation and publishing pipeline.
User Impact
The Control UI recognizes
sv,sv-SE, andsv-FI, offers Svenska, and preserves an existing cached i18n language through reloads. That cached language keeps priority over browser language.Swedish docs navigation, glossary, and translation rules now use the existing docs pipeline. The companion publisher change is openclaw/docs#270. Generated UI strings and docs pages require their normal post-merge translation refresh; this PR intentionally starts with the existing English fallback and does not claim that translated content is already deployed.
Why This Change Was Made
This extends the existing locale registry and docs owners. It also avoids treating an absent translation-memory file as a Vite import, so a newly registered locale builds before its first generated refresh. Present translation memories keep their existing validation.
Rebased onto the reviewed main baseline and retained Daniel Nylander (@yeager)'s original contribution.
Evidence
The final candidate is
0fde5d0ae830537123014ca908c5e7fe6053e2d5, rebased onto reviewed main974d7278758d30a95e6b359889cc9e496fabb7e2. Fresh execution against this exact source tree (d759f6be4ae9a0ecdff231a2e7049863316b00fe) and its dependency lockfile passed on a secretless AWS runner with a signed terminal receipt and exit code 0.sv-SE,sv-FI, cached Swedish, cached French precedence, and reload behavior. These fixtures seed the i18n cache directly; they do not prove a selection made through the separate Settings preference owner. Swedish translation memory is absent, so English fallback remains explicit.The unchanged Go translation prompt and 102-entry keyless raw-copy baseline also passed their earlier focused checks.
The captures below are the initial product comparison: baseline
556a26fa9e44741c1078c0c335885e1b87a8ba14versus candidate7b5a348a66b91e3cbc67eb618587ba82d75f1062. Both use browser localesv-SE; the baseline selects English with no Swedish option, and the candidate selects Swedish with one visible option. These are historical comparison images, not captures of the final rebased head.Maintainer review notes
The docs publisher intentionally omits the external ClawHub tab for every locale; Swedish matches its canonical projection: 12 tabs, 170 nested groups, and 203 unique glossary entries. No new translation service or provider is introduced.
Production TypeScript/Go/MJS: +13/-1, justified by locale capability and the absent-memory build invariant. Locale config: +2/-1. Tests: +123/-3. Authored navigation/glossary data: +1,896 lines. No runtime configuration keys, migrations, or protocol changes.
The first hosted run exposed two synchronization races in existing browser tests. Current main already contains the canonical fixes, so the rebase adopts both main test files unchanged and removes our superseded test corrections from the PR. The locale recovery assertion follows main's current structured guard storage (
JSON.parse(...).buildId). The final diff contains only the 15 Swedish feature, docs, and regression-test files.The previous review requested a v2026.10.3 upgrade recording. That optional recording was not repeated: this change does not alter preference storage or migrate its schema. The current browser tests exercise existing cached Swedish and French i18n values, precedence, and reload; the real before/after run proves the missing-language behavior. This is not presented as a packaged-release upgrade test.
The existing docs translator's Codex developer-instruction contract was checked directly in Codex revision
414782450952a196bbb64b1605a458c2531c47b6:codex-rs/core/src/config/mod.rs:680,3581,session/mod.rs:3117–3120, andagents_md.rs:88–92. Only Swedish prompt wording is added.Screenshot links were checked anonymously against their local PNG hashes and expire on 2026-10-21 at 09:28:55 UTC. Initial Testbox product proof completed successfully; the long-lived lease workflow itself is not the test verdict. Fresh final-head execution is reported above separately.