Skip to content

Commit 86ae2ca

Browse files
fix(platform-objects): zh-CN metadata forms say 仪表盘 for dashboard (#30485)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgJQPdf6eHTz3X8GTdydYyJY)_ domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE Fixes #30164 Clause-②: no Metadata-protocol: none Skills-docs: none (`git grep -n 仪表板 -- skills/` on the final tree: 0 hits) ## 维护者速读 - 改了什么:平台下发的中文仪表盘编辑表单里 6 处“仪表板”改为“仪表盘”(表单标题、基础信息说明、页眉及其显示标题/显示描述、组件的帮助文字)。 - 为什么改:控制台和 Studio 已统一叫“仪表盘”,只有平台下发的这张表单还叫“仪表板”,同一对象一个流程里两个名字。 - 风险与回滚:只改中文显示文字,不动任何键、结构或其他语言;回滚即还原这一个文件。 - 先看:`packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts`(6 行文字),再看新测试 `zh-cn-dashboard-word.test.ts`。 - 两分钟验证:`pnpm --filter @objectstack/platform-objects exec vitest run src/metadata-translations/zh-cn-dashboard-word.test.ts`,预期 2 条通过。 - 需要你做的:无,席位落地。 ## What changes `zh-CN.metadata-forms.generated.ts` is the `os i18n extract` merge baseline (`scripts/i18n-extract.config.ts` pins `metadataForms` to the committed file, and `--merge` only fills gaps), and both its own header and `metadata-translations/index.ts` say its leaves are edited in place. So the six `dashboard` leaves were corrected there, then the bundle regenerated: `pnpm i18n:extract` reproduces the committed tree byte for byte (no diff after the run) and `pnpm check:i18n` is green. No other source under `packages/` carries the zh-CN form text. The source-hash tables are untouched: these leaves are translations, not source copies, so the generated provenance table never recorded them. ## Tests New `packages/platform-objects/src/metadata-translations/zh-cn-dashboard-word.test.ts` reads the SERVED bundle (`MetadataFormsTranslations['zh-CN']`, after `withSourceFallback`, the bundle `rest-server.ts` localizes `/api/v1/meta/types` forms with): the dashboard form title is 仪表盘, and no served zh-CN metadata-form string contains 仪表板. - Red on main's bundle: both tests fail, the second listing the six strings. - Green after the fix; ablation (one leaf put back via `scripts/ablation-replace.mjs`): the class test goes red naming 仪表板标识与描述, restored to the HEAD blob with `git diff HEAD` empty. - `pnpm --filter @objectstack/platform-objects test`: 112 files, 1523 tests passed. `typecheck` (includes `check:test-typecheck`): exit 0. ## Acceptance notes - `packages/rest/src/meta-types-schema-titles.test.ts` and `packages/runtime/src/domains/i18n-translations-served-groups.test.ts` name 仪表板 only inside their own inline fixture bundles and assert the fixture back; they do not read the platform bundle, so they were left as they are. - `packages/spec/src/marketplace/package-l10n.test.ts` and `packages/spec/src/system/i18n-resolver.test.ts` likewise use their own fixtures and do not pin served form text (out of this card's surface, untouched). ## Verification All local readings on head `df4de5fb` (after merging `origin/main`). - `pnpm check:i18n`: exit 0, `check-i18n-bundles: OK (10 package(s) — all bundles in sync, no undeclared authoring keys)`. - `pnpm i18n:extract`: exit 0, 11 files written, `git status` clean afterwards. - `pnpm --filter @objectstack/platform-objects test`: exit 0 (112 files, 1523 tests). `typecheck`: exit 0. - `pnpm lint`: exit 0. - `dispatch-gates --commands`: 58 derived; `--ran` reconciliation: 58 accounted, 56 exit 0, 2 NOT MEASURED (exit 3, PREREQUISITE NOT MET): - `node scripts/check-plugin-teardown-shape.mjs --self-test`: shallow clone cannot reach its pinned positive-control commit (checker-health only, judges no diff). - `pnpm check:dual-build-cjs-loads`: needs every workspace package's `dist/`; only the i18n build closure was built here. CI runs both. <details><summary>Red on main, ablation</summary> Red (main's bundle): `expected '仪表板' to be '仪表盘'`; offenders listed 仪表板, 仪表板标识与描述, 仪表板页眉配置(title、subtitle、actions), 在页眉中显示仪表板标题, 在页眉中显示仪表板描述, 包含位置和尺寸的仪表板组件. `Tests 2 failed (2)`. Ablation: `ablation-replace: ok mutation landed: anchor 1 -> 0`, then `× no served zh-CN metadata-form string carries the retired spelling 仪表板`, `Tests 1 failed | 1 passed (2)`; `ablation-replace: ok restored: blob == HEAD (ab03233) and git diff HEAD is empty`. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CZNuVoLVGgYU36KdYe)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CZNuVoLVGgYU36KdYe --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 75bbebb commit 86ae2ca

3 files changed

Lines changed: 48 additions & 6 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
fix(platform-objects): zh-CN metadata forms say 仪表盘 for dashboard (#30164)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
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.

‎packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,11 +1519,11 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
15191519
}
15201520
},
15211521
dashboard: {
1522-
label: "仪表板",
1522+
label: "仪表盘",
15231523
sections: {
15241524
basics: {
15251525
label: "基础信息",
1526-
description: "仪表板标识与描述"
1526+
description: "仪表盘标识与描述"
15271527
},
15281528
layout: {
15291529
label: "布局",
@@ -1568,15 +1568,15 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
15681568
},
15691569
header: {
15701570
label: "页眉",
1571-
helpText: "仪表板页眉配置(title、subtitle、actions)"
1571+
helpText: "仪表盘页眉配置(title、subtitle、actions)"
15721572
},
15731573
"header.showTitle": {
15741574
label: "显示标题",
1575-
helpText: "在页眉中显示仪表板标题"
1575+
helpText: "在页眉中显示仪表盘标题"
15761576
},
15771577
"header.showDescription": {
15781578
label: "显示描述",
1579-
helpText: "在页眉中显示仪表板描述"
1579+
helpText: "在页眉中显示仪表盘描述"
15801580
},
15811581
"header.actions": {
15821582
label: "操作按钮",
@@ -1596,7 +1596,7 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
15961596
},
15971597
widgets: {
15981598
label: "组件",
1599-
helpText: "包含位置和尺寸的仪表板组件"
1599+
helpText: "包含位置和尺寸的仪表盘组件"
16001600
},
16011601
"widgets.id": {
16021602
label: "组件 ID"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
//
3+
// zh-CN names a dashboard 仪表盘 everywhere (#30039 item 4): the Console and
4+
// Studio already say it, so the metadata forms the platform serves must too.
5+
// This reads the SERVED bundle (`MetadataFormsTranslations`, the one
6+
// `/api/v1/meta/types` localizes forms with, after `withSourceFallback`), not
7+
// the generated file alone, so a stale-source fallback cannot hide the word.
8+
9+
import { describe, it, expect } from 'vitest';
10+
import { MetadataFormsTranslations } from './index.js';
11+
12+
/** Every string leaf under `node`, with its dotted path. */
13+
function leaves(node: unknown, path = ''): Array<[string, string]> {
14+
if (typeof node === 'string') return [[path, node]];
15+
if (!node || typeof node !== 'object') return [];
16+
return Object.entries(node as Record<string, unknown>).flatMap(([k, v]) =>
17+
leaves(v, path ? `${path}.${k}` : k),
18+
);
19+
}
20+
21+
describe('#30164 — served zh-CN metadata forms say 仪表盘 for dashboard', () => {
22+
const served = MetadataFormsTranslations['zh-CN']?.metadataForms as Record<string, any>;
23+
24+
it('the dashboard form title reads 仪表盘', () => {
25+
expect(served?.dashboard?.label).toBe('仪表盘');
26+
});
27+
28+
it('no served zh-CN metadata-form string carries the retired spelling 仪表板', () => {
29+
const offenders = leaves(served).filter(([, text]) => text.includes('仪表板'));
30+
expect(offenders).toEqual([]);
31+
});
32+
});

0 commit comments

Comments
 (0)