fix(cloud-connection): localize the Cloud Connection panel (objectstack#3589 follow-up) - #2865
Merged
Merged
Conversation
…ck#3589 follow-up) `CloudConnectionPanel` — the `cloud-connection:panel` SDUI widget that is the entire body of the Cloud Connection Setup page — had no i18n at all: no `@object-ui/i18n` import, and no `cloudConnection` namespace in any of the ten built-in locale packs. Its siblings on neighbouring pages (`marketplace:installed-list`, `mcp:connect-agent`) were already fully localized, so once the framework-side `page:header` resolution landed (objectstack#3648) this page rendered a translated header above an English body. - New `cloudConnection` namespace in all ten packs, matching the coverage its sibling namespaces already had. Covers every phase of the device-code flow: checking, error + retry, waiting (approval prompt, user code, copy), bound (connection detail labels), and unbound (call to action). - The three hard-coded failure messages are translated where they are raised rather than where they are rendered, since they live in component state. - The "code is pre-filled…" line was one sentence stitched across JSX with a conditional tail and a bare '.'. It is now two self-contained strings, so a translator never receives a dangling clause whose word order is fixed by JSX. - `bound_at` now formats with the active UI language instead of the browser default, matching the surrounding copy. Adds a locale-parity test over the `cloudConnection` key set. Partial coverage is the failure mode worth pinning because it degrades quietly — i18next falls back to `en` and the page merely looks half-translated, which is exactly how this bug and the zh-CN-only `nav_cloud_connection` label both survived. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 27, 2026 13:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to objectstack-ai/objectstack#3589 / objectstack-ai/objectstack#3648, and the remaining "复核其余 SDUI widget 正文 i18n 覆盖" item on #2851.
The gap
CloudConnectionPanel— thecloud-connection:panelSDUI widget that is the entire body of the Cloud Connection Setup page — had no i18n at all: no@object-ui/i18nimport, and nocloudConnectionnamespace in any of the ten built-in locale packs.This was missed because issue #3589 recorded that the three pages' body widgets were "大多已 i18n". Two of them are:
marketplace:installed-listandmcp:connect-agentare fully localized across all ten packs. This one never was. With the framework-sidepage:headerresolution now merged, the page rendered a translated header above an entirely English body — so the fix for that issue left this page visibly half-done.Changes
New
cloudConnectionnamespace in all ten packs (en, zh, ja, ko, de, fr, es, pt, ru, ar), matching the coverage its sibling namespaces already had. It covers every phase of the RFC 8628 device-code flow:checking, error +retry,waiting.*(approval prompt, user code, copy/copied),bound.*(the connection detail labels), andunbound.*(the call to action).Failure messages are translated where they are raised, not where they are rendered. The three hard-coded literals (expired request, bind failure, device-code request failure) are stored in component state and rendered later via
phase.message, so translating at the render site was not an option.tis added to the twouseCallbackdependency arrays accordingly.One stitched sentence was restructured. The "code is pre-filled…" line was a single sentence assembled across JSX from a fragment, a conditional tail (
— if the window did not appear,), an anchor, and a bare'.'. Translating that shape hands a translator a dangling clause whose word order JSX has already fixed — unworkable for languages that order clauses differently. It is now two self-contained strings: a complete sentence plus a standalone link phrase.bound_atformats with the active UI language (toLocaleString(language)) rather than the browser default, so the timestamp matches the copy around it.Testing
packages/i18n/src/__tests__/cloudConnection-locale-parity.test.tsasserts thecloudConnectionkey set is identical across all ten packs, every leaf is a non-empty string, and the prose keys in non-English packs actually differ from English (short labels like "Runtime" are excluded — they legitimately collide).Partial coverage is the failure mode worth pinning, because it degrades quietly: i18next falls back to
enand the result merely looks half-translated. That is exactly how both this bug and the zh-CN-onlynav_cloud_connectionlabel survived unnoticed.I mutation-tested the guard rather than trusting a green run — deleting one key from
zh.tsfails it, restoring passes.Suites run locally:
@object-ui/i18n110 passed,@object-ui/app-shell1859 passed,turbo type-checkgreen for both packages, ESLint clean on all changed files (no new warnings).Not covered here
The panel keeps its pre-existing
catch (err: any)blocks and theset-state-in-effectlint warning inuseEffect— both predate this change and are out of scope for a localization pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01TubWYdWquVkS9dj733sDmC
Generated by Claude Code