fix(app-shell): localize popup-blocked toast and SSO spinner tab copy via i18n (#3321) - #3328
Merged
Merged
Conversation
… via i18n (#3321) The opensInNewTab choreography in consoleServerAction.ts shipped hard-coded bilingual Chinese/English copy, violating AGENTS.md Commandment #-1. The four strings (spinner tab title + body, popup-blocked toast title/description/ action label) now route through new console.serverAction.* keys in @object-ui/i18n (all eleven locale packs, key parity kept), injected via an optional i18next-style t option on createConsoleServerActionHandler from the two hook-context call sites; English defaults apply when t is omitted. Locale strings are HTML-escaped before entering the spinner document. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…unction Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
xuyushun441-sys
marked this pull request as ready for review
August 4, 2026 01:48
This was referenced Aug 4, 2026
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.
Fixes #3321
问题
consoleServerAction.ts的opensInNewTab编排里硬编码了中英双语文案,违反 AGENTS.md Commandment #-1(代码库纯英文)。四处文案:正在打开… Opening…正在为你打开环境…浏览器拦截了弹窗 / Popup blocked点击在新标签页打开环境+ action label打开环境方案(采用 issue 评论 PM 预裁决的首选方案:
t经 options 注入,非底线纯英文字面量方案——i18n 键位与基建顺畅,无需降级)t经 options 注入:createConsoleServerActionHandler新增可选t?: ConsoleServerActionTranslate(i18next 风格t(key, englishDefault))。包装器是普通函数不能调 hook,两个调用点(useConsoleActionRuntime、RecordDetailView)都有 hook 上下文,用useObjectTranslation().t经 env ref 注入——语言切换即时生效,且不打断 handler 实例的稳定性(in-flight guard 依赖同一实例)。t(测试 / standalone)时全部落到英文默认值;代码里不再有任何非英文文案。console.serverAction.*五个键(openingTitle/openingBody/popupBlockedTitle/popupBlockedDescription/popupBlockedAction),11 个 locale 包全量补齐(en/zh/de/es/fr/ja/ko/pt/ru/ar,all-locales-key-parity强制对齐)。escapeHtml),有测试钉住。opensInNewTabserver action 都走它),原中文「打开环境」是 cloud SSO 场景专属词汇;新文案改为通用表述("Open in new tab" 等),避免把 cloud 词汇固化进 app-shell。如维护者希望保留「环境」措辞,改 locale 资源文件即可,不用动代码。验证
pnpm exec vitest run --maxWorkers=2consoleServerAction / actions-envelope.ratchet / useConsoleActionRuntime / RecordDetailView.modalDispatch / all-locales-key-parity / en-zh-key-parityt走键位(tab + toast)、HTML 转义、无 CJK pin)opens lazily…toast fallback、no CJK in code,2 failed / 12 passed)→ 还原 → 14/14 绿pnpm exec eslint <改动文件>no-explicit-anywarning,均非新增行)Changeset
@object-ui/app-shell+@object-ui/i18n均 patch(fixed group 联动,无 major)。🤖 Generated with Claude Code
https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa