Skip to content

[Studio i18n] 表单布局设计器未解析已有的对象字段和分组翻译 #3134

Description

@os-zhuang

复现

  1. HotCRM 的 zh-CN 翻译已声明 objects.crm_opportunity.fields.name.label = 商机名称,以及 objects.crm_opportunity._sections.basic.label = 基本信息。
  2. 以中文进入 Studio → 数据 → 商机 → 表单 → 布局。
  3. 画布仍显示 Opportunity Name 和 Basic Information;同一对象的常规数据视图会正确显示商机名称和基本信息。

这不是种子数据的翻译问题:翻译键存在,且运行态其他表面已能解析。

根因证据

ObjectFormDesigner 的职责说明称布局画布应当与最终用户表单一致,但它直接读取原始元数据:

  • SortableField 使用 entry.def.label 作为显示名称。
  • 分组标题使用 g.label 或 g.key。
  • 组件没有调用已经存在的 useObjectLabel().fieldLabel / sectionLabel。

因此,项目可以提供 objects. 的 fields 和 _sections 翻译,却无法让 Studio 的表单布局画布使用它们。

期望

  • 布局画布按当前语言解析 objects.._sections..label 与 objects..fields..label。
  • 找不到翻译时继续回退到元数据的英文 label。
  • 右侧属性编辑器仍可编辑原始元数据 label;展示值与被编辑的源值不应混淆。
  • 语言切换后画布应重新解析。
  • 为字段和分组各增加一个中文翻译的回归测试。
  • 影响

    中文 Studio 的表单设计截图和实际 WYSIWYG 预览呈现中英文混排;项目侧补全翻译无法解决。

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions