diff --git a/.changeset/30164-zh-cn-dashboard-word.md b/.changeset/30164-zh-cn-dashboard-word.md new file mode 100644 index 00000000000..f06325194be --- /dev/null +++ b/.changeset/30164-zh-cn-dashboard-word.md @@ -0,0 +1,10 @@ +--- +'@objectstack/platform-objects': patch +--- + +fix(platform-objects): zh-CN metadata forms say 仪表盘 for dashboard (#30164) + +Clause-②: no +Metadata-protocol: none + +The zh-CN dashboard authoring form the platform serves (`MetadataFormsTranslations`, which `/api/v1/meta/types` localizes forms with) still said 仪表板 on six strings: the form title, the basics section description, and the help text of the header, show-title, show-description and widgets fields. The Console and Studio say 仪表盘, so one object carried two names in one flow of work. All six now say 仪表盘. The generated bundle is the extract's merge baseline, so its leaves were corrected in place and the bundle regenerated (`pnpm i18n:extract` reproduces it byte for byte; `pnpm check:i18n` is green). en, ja-JP and es-ES are unchanged. diff --git a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts index 1af56185ef5..ab03233a6fe 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts @@ -1519,11 +1519,11 @@ export const zhCNMetadataForms: NonNullable = } }, dashboard: { - label: "仪表板", + label: "仪表盘", sections: { basics: { label: "基础信息", - description: "仪表板标识与描述" + description: "仪表盘标识与描述" }, layout: { label: "布局", @@ -1568,15 +1568,15 @@ export const zhCNMetadataForms: NonNullable = }, header: { label: "页眉", - helpText: "仪表板页眉配置(title、subtitle、actions)" + helpText: "仪表盘页眉配置(title、subtitle、actions)" }, "header.showTitle": { label: "显示标题", - helpText: "在页眉中显示仪表板标题" + helpText: "在页眉中显示仪表盘标题" }, "header.showDescription": { label: "显示描述", - helpText: "在页眉中显示仪表板描述" + helpText: "在页眉中显示仪表盘描述" }, "header.actions": { label: "操作按钮", @@ -1596,7 +1596,7 @@ export const zhCNMetadataForms: NonNullable = }, widgets: { label: "组件", - helpText: "包含位置和尺寸的仪表板组件" + helpText: "包含位置和尺寸的仪表盘组件" }, "widgets.id": { label: "组件 ID" diff --git a/packages/platform-objects/src/metadata-translations/zh-cn-dashboard-word.test.ts b/packages/platform-objects/src/metadata-translations/zh-cn-dashboard-word.test.ts new file mode 100644 index 00000000000..a2bd9329746 --- /dev/null +++ b/packages/platform-objects/src/metadata-translations/zh-cn-dashboard-word.test.ts @@ -0,0 +1,32 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. +// +// zh-CN names a dashboard 仪表盘 everywhere (#30039 item 4): the Console and +// Studio already say it, so the metadata forms the platform serves must too. +// This reads the SERVED bundle (`MetadataFormsTranslations`, the one +// `/api/v1/meta/types` localizes forms with, after `withSourceFallback`), not +// the generated file alone, so a stale-source fallback cannot hide the word. + +import { describe, it, expect } from 'vitest'; +import { MetadataFormsTranslations } from './index.js'; + +/** Every string leaf under `node`, with its dotted path. */ +function leaves(node: unknown, path = ''): Array<[string, string]> { + if (typeof node === 'string') return [[path, node]]; + if (!node || typeof node !== 'object') return []; + return Object.entries(node as Record).flatMap(([k, v]) => + leaves(v, path ? `${path}.${k}` : k), + ); +} + +describe('#30164 — served zh-CN metadata forms say 仪表盘 for dashboard', () => { + const served = MetadataFormsTranslations['zh-CN']?.metadataForms as Record; + + it('the dashboard form title reads 仪表盘', () => { + expect(served?.dashboard?.label).toBe('仪表盘'); + }); + + it('no served zh-CN metadata-form string carries the retired spelling 仪表板', () => { + const offenders = leaves(served).filter(([, text]) => text.includes('仪表板')); + expect(offenders).toEqual([]); + }); +});