实施 #5611 (RecordDetailsProps.sections 改对象形式)时,按"规则消费半径"清扫 component.zod.ts 的真实授权方发现的范围外问题 —— 与 #5611 /#5176 同一族(声明与授权不一致,靠 props 无解析闸门苟活),但不是同一个键 ,故另开。未在 #5611 的 PR 中修复。
实测
packages/spec/src/ui/i18n.zod.ts:80 把 I18nLabelSchema 定义为纯字符串 ,且文档注释明确排除内联 i18n 对象:
export const I18nLabelSchema = lazySchema ( ( ) => z . string ( ) . describe ( 'Display label (plain string; i18n keys are auto-generated by the framework)' ) ) ;
"Developers only need to provide the default-language string; translations are managed through translation files, not inline i18n objects ."
而 component.zod.ts 用它声明的键,被平台页大量授权为内联多语言 map :
RecordRelatedListProps.title(component.zod.ts:189)→ I18nLabelSchema.optional()
PageTabsProps.items[].label(component.zod.ts:118)→ I18nLabelSchema(必填)
PageAccordionProps 同形(component.zod.ts:297)
真实授权(共 31 处,分布在 3 个已发布平台页):
// packages/platform-objects/src/pages/sys-organization.page.ts:55
label : { en : 'Members' , 'zh-CN' : '成员' , 'ja-JP' : 'メンバー' , 'es-ES' : 'Miembros' } ,
// packages/platform-objects/src/pages/sys-position.page.ts:66
title : { en : 'Holders' , 'zh-CN' : '任职人员' , 'ja-JP' : '在任者' , 'es-ES' : 'Titulares' } ,
文件
内联 map 授权处数
sys-user.page.ts
19
sys-organization.page.ts
6
sys-position.page.ts
6
这一形状是被兑现的,不是死代码。 objectui 的 record-details.tsx:194 用 pickLocalized(rawTitleSrc, language) 真的解析它;仓内 packages/cli/src/utils/i18n-extract.ts:398-401 也明确知道并处理这一形状(注释:"a localized-map label ({ en, 'zh-CN' }) is already multilingual")。所以这与 #4667 退休的 book 内联 translations 不同 —— 那个没有任何 resolver 读取 ,这个有。
为什么现在值得处理
需要裁定的方向
不自行猜测,列出选项:
倾向 A ,但需先测 tab label / related-list title 在 bundle 侧有无 resolver(#5377 提示 view 的 tabs[].label 正是"无 translation key 也无 resolver"),若无则 A 会造成翻译能力倒退。这超出 #5611 的范围与我的判断范围,故不动、只记录。
关系
与 RecordDetailsProps 与真实页面的授权形状不符:sections 声明为 string[] 但所有页面授权对象形式,hideFields 完全未声明 #5611 / RecordHighlightsField does not declare readonly, so the spec silently strips the key the chip gate reads #5176 同族但不同键 ;RecordDetailsProps 与真实页面的授权形状不符:sections 声明为 string[] 但所有页面授权对象形式,hideFields 完全未声明 #5611 的 PR 已合规地未越界(它只声明 sections[].label 为 I18nLabelSchema,与本文件其余键保持一致,不为单个键分叉契约 —— 正因如此,这两处 section label 也落入本 issue 的范围)。
与 SDUI 组件 props 没有解析闸门:PageComponent.properties 是开放 record,ComponentPropsMap 的 29 个站点从不被 parse(#4001 批 17 的 no gate 判定) #5068 的关系同 RecordDetailsProps 与真实页面的授权形状不符:sections 声明为 string[] 但所有页面授权对象形式,hideFields 完全未声明 #5611 :必须在 props 校验闸门 warning→error 升级前解决 ,否则闸门一升级即产生硬解析错误。建议按 RecordDetailsProps 与真实页面的授权形状不符:sections 声明为 string[] 但所有页面授权对象形式,hideFields 完全未声明 #5611 /RecordHighlightsField does not declare readonly, so the spec silently strips the key the chip gate reads #5176 先例登记为 SDUI 组件 props 没有解析闸门:PageComponent.properties 是开放 record,ComponentPropsMap 的 29 个站点从不被 parse(#4001 批 17 的 no gate 判定) #5068 的前置。
参考 spec: view tab labels (tabs[].label) have no translation key and no resolver — the list-page tab bar is untranslatable in every locale #5377 (view 的 tabs[].label 无 translation key 无 resolver)—— 不同表面,但同一"标题翻译能力"族,A 方案的可行性取决于它。
实施 #5611(
RecordDetailsProps.sections改对象形式)时,按"规则消费半径"清扫component.zod.ts的真实授权方发现的范围外问题 —— 与 #5611/#5176 同一族(声明与授权不一致,靠 props 无解析闸门苟活),但不是同一个键,故另开。未在 #5611 的 PR 中修复。实测
packages/spec/src/ui/i18n.zod.ts:80把I18nLabelSchema定义为纯字符串,且文档注释明确排除内联 i18n 对象:而
component.zod.ts用它声明的键,被平台页大量授权为内联多语言 map:RecordRelatedListProps.title(component.zod.ts:189)→I18nLabelSchema.optional()PageTabsProps.items[].label(component.zod.ts:118)→I18nLabelSchema(必填)PageAccordionProps同形(component.zod.ts:297)真实授权(共 31 处,分布在 3 个已发布平台页):
sys-user.page.tssys-organization.page.tssys-position.page.ts这一形状是被兑现的,不是死代码。 objectui 的
record-details.tsx:194用pickLocalized(rawTitleSrc, language)真的解析它;仓内packages/cli/src/utils/i18n-extract.ts:398-401也明确知道并处理这一形状(注释:"a localized-map label ({ en, 'zh-CN' }) is already multilingual")。所以这与 #4667 退休的 book 内联 translations 不同 —— 那个没有任何 resolver 读取,这个有。为什么现在值得处理
content/docs/references/ui/component.mdx会照 schema 告诉作者title/label是string。一个照参考写的 AI 作者会授权纯字符串,得到一个只有单语言的平台页;而仓库自己的平台页全部反过来写。权威文档是错的那一份 —— 与 RecordDetailsProps 与真实页面的授权形状不符:sections声明为 string[] 但所有页面授权对象形式,hideFields完全未声明 #5611 完全同一条理由。PageComponent.properties是开放 record,ComponentPropsMap的 29 个站点从不被 parse(#4001 批 17 的 no gate 判定) #5068 闸门落地时会硬失败。z.string()会直接拒绝{en, zh-CN, ...}对象,3 个已发布平台页的 31 处授权全部变成硬解析错误。需要裁定的方向
不自行猜测,列出选项:
objects.*._sections.*.label等)。与I18nLabelSchema现有文档一致、与 清空剩余 6 条 authorWarn 死键 —— book ×2 / job.id / translation.validationMessages / app.homePageId / app.areas[].order(ADR-0049,v17 限时) #4667 方向一致;代价:31 处改写,且要确认每个键都有 bundle 归宿(tab label / related-list title 是否有 resolver 需先测)。I18nLabelSchema—— 改为z.union([z.string(), z.record(z.string(), z.string())])。一处改动即覆盖全部键;代价:把内联 map 固化成长期契约,与该 schema 现有文档和 清空剩余 6 条 authorWarn 死键 —— book ×2 / job.id / translation.validationMessages / app.homePageId / app.areas[].order(ADR-0049,v17 限时) #4667 的退休方向相反。倾向 A,但需先测 tab label / related-list title 在 bundle 侧有无 resolver(#5377 提示 view 的
tabs[].label正是"无 translation key 也无 resolver"),若无则 A 会造成翻译能力倒退。这超出 #5611 的范围与我的判断范围,故不动、只记录。关系
sections声明为 string[] 但所有页面授权对象形式,hideFields完全未声明 #5611 /RecordHighlightsFielddoes not declarereadonly, so the spec silently strips the key the chip gate reads #5176 同族但不同键;RecordDetailsProps 与真实页面的授权形状不符:sections声明为 string[] 但所有页面授权对象形式,hideFields完全未声明 #5611 的 PR 已合规地未越界(它只声明sections[].label为I18nLabelSchema,与本文件其余键保持一致,不为单个键分叉契约 —— 正因如此,这两处 section label 也落入本 issue 的范围)。PageComponent.properties是开放 record,ComponentPropsMap的 29 个站点从不被 parse(#4001 批 17 的 no gate 判定) #5068 的关系同 RecordDetailsProps 与真实页面的授权形状不符:sections声明为 string[] 但所有页面授权对象形式,hideFields完全未声明 #5611:必须在 props 校验闸门 warning→error 升级前解决,否则闸门一升级即产生硬解析错误。建议按 RecordDetailsProps 与真实页面的授权形状不符:sections声明为 string[] 但所有页面授权对象形式,hideFields完全未声明 #5611/RecordHighlightsFielddoes not declarereadonly, so the spec silently strips the key the chip gate reads #5176 先例登记为 SDUI 组件 props 没有解析闸门:PageComponent.properties是开放 record,ComponentPropsMap的 29 个站点从不被 parse(#4001 批 17 的 no gate 判定) #5068 的前置。tabs[].label) have no translation key and no resolver — the list-page tab bar is untranslatable in every locale #5377(view 的tabs[].label无 translation key 无 resolver)—— 不同表面,但同一"标题翻译能力"族,A 方案的可行性取决于它。