i18n: localize the View variant inspector labels#1503
Merged
Conversation
The View variant inspector (the View home panel, also hosted by the runtime ObjectView right-rail editor) rendered hardcoded English labels. Route them through the metadata-admin i18n catalog (en + zh) so the runtime console and studio both localize: kind/close/label/type/object/placeholders, the "spec schema unavailable" hint, and the view-type dropdown options.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
背景
#1496 把运行时
ObjectView的视图编辑统一到了 studio 的 spec 驱动ViewVariantInspector。但该 inspector 的字段标签是硬编码英文("Label" / "View type" / "Object" 等),在中文 console 里会显示英文、与周边 UI 不一致。改动
把
ViewVariantInspector的硬编码英文全部接入 metadata-admin 的 i18n 词表(t(key, locale),en + zh):engine.inspector.view.*词条(kind / close / label / type / object / 两个 placeholder / "spec schema unavailable" 提示 / 视图类型下拉的 grid·kanban·calendar·gallery·gantt·timeline·map·chart 标签),en 与 zh 双语。ViewVariantInspector改用t(..., locale);视图类型下拉走 i18n 并保留英文兜底(spec 新增类型时回退到原TYPE_LABELS,再回退到原值)。该组件同时被 studio 的视图编辑和运行时右栏编辑器复用,两处一起本地化受益。
验证
pnpm turbo run build --filter=@object-ui/app-shell通过(27/27)。app-shell/metadata-admin+ 适配器相关单测 155 全过。https://claude.ai/code/session_01SZW3fVCCbijEibXtEH3ZGL
Generated by Claude Code