Skip to content

Commit 220b5d3

Browse files
committed
fix(platform-objects): distinct zh-CN/ja-JP labels for the two Setup organization nav entries
nav_organization (current organization record) and nav_organizations (the organization list under org-scoping) both translated to "组织" / "組織", so People & Organization showed two identical entries. Rename them to 当前组织 / 所有组织 and 現在の組織 / すべての組織, and add a test that no two entries in one Setup nav group share a label in any locale. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RDdLaUJMtzFXcrF3gyzpJD
1 parent f2b6cf2 commit 220b5d3

4 files changed

Lines changed: 57 additions & 4 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): Setup → People & Organization no longer shows two identical "组织" / "組織" entries
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`nav_organization` (the active organization's record page) and `nav_organizations` (the organization list, shown where `org-scoping` is mounted) both translated to "组织" in zh-CN and "組織" in ja-JP, so a multi-organization deployment showed two identical menu entries that open different pages. They now read "当前组织" / "所有组织" (zh-CN) and "現在の組織" / "すべての組織" (ja-JP). A new test fails when any two entries in one Setup nav group read the same in any shipped locale.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
//
3+
// No two Setup nav entries in one group read the same in any locale.
4+
//
5+
// The defect: People & Organization carries `nav_organization` (the active
6+
// organization's record page) and `nav_organizations` (the organization list,
7+
// shown where `org-scoping` is mounted). English tells them apart by the
8+
// plural; zh-CN and ja-JP have no plural, so both read "组织" / "組織" and a
9+
// multi-organization deployment showed two identical menu entries that open
10+
// different pages.
11+
import { describe, it, expect } from 'vitest';
12+
13+
import { SETUP_NAV_CONTRIBUTIONS } from './setup-nav.contributions.js';
14+
import { en } from './translations/en.js';
15+
import { zhCN } from './translations/zh-CN.js';
16+
import { jaJP } from './translations/ja-JP.js';
17+
import { esES } from './translations/es-ES.js';
18+
19+
const LOCALES = { en, 'zh-CN': zhCN, 'ja-JP': jaJP, 'es-ES': esES } as const;
20+
21+
type NavItem = { id?: string; label?: string };
22+
23+
describe('Setup nav labels are distinct within a group', () => {
24+
for (const [locale, bundle] of Object.entries(LOCALES)) {
25+
const navigation = ((bundle as any).apps?.setup?.navigation ?? {}) as Record<string, { label?: string }>;
26+
27+
for (const contribution of SETUP_NAV_CONTRIBUTIONS) {
28+
it(`${locale} · ${contribution.group}`, () => {
29+
const seen = new Map<string, string>();
30+
for (const item of (contribution.items ?? []) as NavItem[]) {
31+
if (!item.id) continue;
32+
const label = navigation[item.id]?.label ?? item.label;
33+
if (!label) continue;
34+
expect(
35+
seen.get(label),
36+
`${item.id} and ${seen.get(label)} both read "${label}" in ${locale}`,
37+
).toBeUndefined();
38+
seen.set(label, item.id);
39+
}
40+
});
41+
}
42+
}
43+
});

‎packages/platform-objects/src/apps/translations/ja-JP.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export const jaJP: TranslationData = {
5454
nav_system_overview: { label: 'システム概要' },
5555

5656
nav_users: { label: 'ユーザー' },
57-
nav_organization: { label: '組織' },
57+
nav_organization: { label: '現在の組織' },
5858
nav_business_units: { label: 'ビジネスユニット' },
5959
nav_teams: { label: 'チーム' },
60-
nav_organizations: { label: '組織' },
60+
nav_organizations: { label: 'すべての組織' },
6161
nav_invitations: { label: '招待' },
6262

6363
nav_positions: { label: 'ポジション' },

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ export const zhCN: TranslationData = {
5757
nav_system_overview: { label: '系统概览' },
5858

5959
nav_users: { label: '用户' },
60-
nav_organization: { label: '组织' },
60+
nav_organization: { label: '当前组织' },
6161
nav_business_units: { label: '业务单元' },
6262
nav_teams: { label: '团队' },
63-
nav_organizations: { label: '组织' },
63+
nav_organizations: { label: '所有组织' },
6464
nav_invitations: { label: '邀请' },
6565

6666
nav_positions: { label: '岗位' },

0 commit comments

Comments
 (0)