Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/30164-zh-cn-dashboard-word.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -1519,11 +1519,11 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
}
},
dashboard: {
label: "仪表板",
label: "仪表盘",
sections: {
basics: {
label: "基础信息",
description: "仪表板标识与描述"
description: "仪表盘标识与描述"
},
layout: {
label: "布局",
Expand Down Expand Up @@ -1568,15 +1568,15 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
header: {
label: "页眉",
helpText: "仪表板页眉配置(title、subtitle、actions)"
helpText: "仪表盘页眉配置(title、subtitle、actions)"
},
"header.showTitle": {
label: "显示标题",
helpText: "在页眉中显示仪表板标题"
helpText: "在页眉中显示仪表盘标题"
},
"header.showDescription": {
label: "显示描述",
helpText: "在页眉中显示仪表板描述"
helpText: "在页眉中显示仪表盘描述"
},
"header.actions": {
label: "操作按钮",
Expand All @@ -1596,7 +1596,7 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
widgets: {
label: "组件",
helpText: "包含位置和尺寸的仪表板组件"
helpText: "包含位置和尺寸的仪表盘组件"
},
"widgets.id": {
label: "组件 ID"
Expand Down
Original file line number Diff line number Diff line change
@@ -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<string, unknown>).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<string, any>;

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([]);
});
});
Loading