fix(app-shell): i18n managed-by empty states#1611
Open
baozhoutao wants to merge 1 commit into
Open
Conversation
…er-auth)
resolveManagedByEmptyState hardcoded English titles/messages, so list views for managed objects (identity, audit logs, system-generated) showed English regardless of locale. It now takes the t translator and resolves list.managedBy.{system,appendOnly,betterAuth}.{title,message} (English kept as defaultValue fallbacks); ObjectView passes its t through. Added the keys to the en and zh locale packs.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Author
ℹ️ The failing
|
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.
问题
/_console/apps/setup/sys_organization(以及其他受管对象列表:身份、审计日志、系统生成记录)在空状态下显示硬编码英文,无论界面语言:根因:
packages/app-shell/src/utils/managedByEmptyState.ts的resolveManagedByEmptyState对system/append-only/better-auth三种managedBy桶返回写死的英文 title/message。注意这与通用 ListView 空状态(list.firstRunTitle/list.noMatches,已在 #1555 国际化)是不同的代码路径——受管对象会用这个自定义空状态覆盖通用文案。改动
resolveManagedByEmptyState(managedBy, t)新增t参数,改为解析list.managedBy.{system,appendOnly,betterAuth}.{title,message},英文保留为defaultValue兜底(缺 key 的语言行为不变)。ObjectView.tsx在调用处传入其t。packages/i18n/src/locales/en.ts、zh.ts新增对应 key(其余语言走 fallback 链 = 英文,与现状一致)。验证
在 framework showcase 控制台(zh 语言)本地重建
@object-ui/consoledist 并实地访问组织列表页,空状态已渲染中文:英文文案已完全消失。
@object-ui/console构建 32/32 通过;@object-ui/i18ntsc干净;改动行未引入新的类型错误(app-shell 既有 tsc 噪音与本次无关)。附 changeset(
@object-ui/app-shell/@object-ui/i18npatch)。