Skip to content

Commit b3bcfef

Browse files
fix(i18n): the record timeline's events chip reads 事件 / Events, and the Chinese stream says 动态 (#36317)
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTRdLmK9YYgMSCJ7NH2PuUY)_ Fixes #36148 Clause-②: no Metadata-protocol: none Ruling-ref: 7074372050 ## 维护者速读 - 记录页「动态」里的筛选从「全部 · 活动 · 讨论 · 变更」改为「全部 · 事件 · 讨论 · 变更」,英文 Events;中文的空状态改为「暂无动态」,旧标题、无权限、加载失败和筛选读屏标签都改说「动态」。 - 按你 04:45 选的 A(「A 改叫「事件」」)执行;每个筛选装什么不变,「变更」仍只放带前后值的字段变更(#30074 裁定 C)。 - 出错时最坏是某个语言的筛选或空状态字眼不对,不影响数据;只改语言包的值和一处英文兜底,可直接撤回。 - 无 ## What changes - `detail.streamActivity` (the stream's events chip): zh-Hans and zh-Hant 「事件」, en `Events`, and each other pack's own word for events: de `Ereignisse`, es `Eventos`, fr `Événements`, ja `イベント`, ko `이벤트`, pt-BR `Eventos`, ru `События`, ar `الأحداث`. The row reads 「全部 · 事件 · 讨论 · 变更」. What the chip holds is unchanged (ruling 6649643659 on #30074, option C). - zh-Hans and zh-Hant only, the rest of the stream takes the tab's word: `detail.noActivity` 「暂无动态」 / 「暫無動態」 (the panel's one empty state, drawn under every chip), `detail.activity` 「动态」 / 「動態」 (now equal to `detail.timeline`, as in the other nine packs), `detail.activityAccessDenied`, `detail.activityLoadFailed` and `detail.filterActivity` say 动态. The other packs keep those four values. - `RecordActivityTimeline.tsx`: the events chip's in-code English fallback follows the pack (`'Events'`); comments naming the chip row updated there and in `recordTimelineStream.ts`. - Values only: no key added, renamed or removed. zh-Hant matches what `gen:zh-hant` writes (the generator left the pack unchanged after the edit). Read first, by risk: 1. `ui/packages/i18n/src/locales/zh-Hans.ts` — the six `detail` values. 2. `ui/packages/i18n/src/locales/en.ts` — `streamActivity: 'Events'`. 3. `ui/packages/i18n/src/__tests__/timelineFilterWording-36148.test.ts` — the new pins. Two-minute verification: `pnpm --dir ui exec vitest run packages/i18n/src/__tests__/timelineFilterWording-36148.test.ts` from the repo root; expect 16 passed. ## Tests - New `timelineFilterWording-36148.test.ts` (i18n): in zh-Hans and zh-Hant no string the stream draws (title, chips, empty, access-denied, load-failed, filter label) says 活动 / 活動, and the chip, empty state and title read 事件 / 暂无动态 / 动态; en names the chip Events; in every pack the events chip differs from the tab word, the stream title and the field-history chip. - Old pins updated to the ruled words: `ActivityTimeline.i18n.test.tsx` (zh empty state), `ActivityTimeline.remainingLiterals.i18n.test.tsx` (zh card title, whole zh card text, chip group label), `detail-landmark-aria-i18n-4645.test.tsx` (zh landmark name). - Ablation (one-off, not kept): zh-Hans `streamActivity` set back to 「活动」 on disk after the commit: 2 failed / 14 passed ("no string the stream draws says 活动", "the chip reads 事件 …"); restored with `git checkout HEAD --`, 16 passed. ## Acceptance notes - Done-when, measured live: hotcrm (18.6.0 server, `pnpm dev` on a fresh database) with this branch's Console source (Vite, `DEV_PROXY_TARGET` to the hotcrm server), a zh-CN browser, admin user, a seeded lead. The record tab row reads 「线索 · 客户 · 活动 · 活动参与者 · 任务 · 营销活动成员 2 · 动态 2」 and the stream heads 「动态 (2)」. Every 活动 on the page is one of hotcrm's own labels (the `crm_event` tab and nav entry, 活动参与者, 营销活动成员, 销售活动). On this page the 动态 tab is a slotted page's `record:chatter`, which since #36221 lists the system history alone, so no chip row draws there; the chips and empty state are pinned by the tests above rather than by this page. - Out of the claim's declared surface (locale packs): `ui/packages/plugin-detail/src/RecordActivityTimeline.tsx` (the en fallback, named by the ruling), `ui/packages/plugin-detail/src/recordTimelineStream.ts` (comments only) and three plugin-detail pin tests. None is a seat-1 hot file. - Out of the claim's declared surface, added at `dd26af31`: `ui/packages/components/src/renderers/layout/containers.tsx`, `KNOWN_LABEL_DICT` `Activity` 「活动」/「活動」 → 「动态」/「動態」, with `@object-ui/components` in the changeset. Why: it is the page-tab strip's own copy of the label, read ahead of the pack, so without it an authored `Activity` tab kept 活动 and `page-tabs-builtin-label-i18n-4645.test.tsx` went red on `12a825da` (Test UI 4/16). Ruling 7074372050 item 3 sets an authored `Activity` tab to 动态, the same word as `detail.timeline`. Claim amended on #36148 for this file and `RecordActivityTimeline.tsx`. - Residual (stated, not a defect): in zh an `Activity` tab and the `Activity stream` tab both read 动态. Both draw on one strip only when a page author writes both labels. Measured: the synthesized record page writes only `Activity stream` (`buildDefaultPageSchema.ts:1094`); no authored `Activity` page tab in `examples/**` or hotcrm (the `'Activity'` hits are an object label and a nav group). The equality is the ruling's choice (item 3). - Not changed, measured: `useDetailTranslation.ts` has no `detail.streamActivity` default, so there is no second English fallback for the chip. ## Verification Readings at head `12a825da`, taken under `scripts/pm/os-verify-lock.sh` (shared box). <details><summary>Packages (green)</summary> - `pnpm --dir ui exec vitest run packages/i18n/`: Test Files 106 passed (106); Tests 1978 passed, 13 skipped. - `pnpm --dir ui exec vitest run packages/plugin-detail/` before the pin updates: 4 failed in the two `ActivityTimeline` i18n files (old zh strings), 405 files passed; after the updates those two files: 20 passed (20). - `pnpm --filter @object-ui/i18n run type-check` (both projects): exit 0. `eslint` on the 10 touched TS files: 0 errors (one pre-existing `react-refresh` warning at `RecordActivityTimeline.tsx:263`, an untouched line). - `node ui/packages/i18n/scripts/gen-zh-hant.mjs`: no file changed. </details> <details><summary>Derived gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` derived 41 commands for this diff; all 41 ran and exited 0, among them `check:nul-bytes`, `check:published-files`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:type-check-coverage`, `check:type-check-debt` (0 entries re-measured, none above its number), `check-sdui-manifest`, `check-adr-0087-registration --base origin/main`, `check-empty-changeset --base origin/main`, `check-changeset-no-major --base origin/main` and `pnpm --dir ui exec vitest run scripts/` (Test Files 172 passed, 2 skipped; Tests 5122 passed, 2 skipped). - `--ran` reconciliation: 41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN, every line carrying its exit code. - `node scripts/pm/overlap-check.mjs --branch=claude/project-thread-r2g68m`: VERDICT clean against origin/main and the three open PRs that share the locale files (#36295, #36288, #36223). - Type-check lanes, `check:i18n` (its prerequisite is the CLI build closure; this diff touches no `translations/*.generated.ts`) and the repo-wide lint are CI's. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5oHi42qJhgAop8CaLs)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5oHi42qJhgAop8CaLs --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent bd22740 commit b3bcfef

19 files changed

Lines changed: 126 additions & 35 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/i18n': patch
3+
'@object-ui/plugin-detail': patch
4+
'@object-ui/components': patch
5+
---
6+
7+
fix(i18n): the record timeline's events chip reads 事件 / Events, and the Chinese stream says 动态, never 活动
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The record page's 动态 tab drew its chips as 「全部 · 活动 · 讨论 · 变更」, so an app with an object named 活动 (a CRM's meetings and calls) showed 活动 twice on one screen with two meanings, and the English tab Activity held a chip also named Activity. The chips now read 「全部 · 事件 · 讨论 · 变更」 (zh-Hant the same), Events in English, and each other pack's own word for events (Ereignisse, Eventos, Événements, イベント, 이벤트, Eventos, События, الأحداث). What each chip holds is unchanged: 变更 / Changes keeps the audit-sourced field changes, and created, updated, assigned and shared rows stay under the events chip.
13+
14+
In zh-Hans and zh-Hant the rest of the stream takes the tab's word: the empty state reads 「暂无动态」 (「暫無動態」), the stream title `detail.activity` reads 「动态」 like `detail.timeline`, and the access-denied, load-failed and filter labels say 动态. The English chip's in-code fallback follows the pack, and the tab strip's Chinese token map reads an `Activity` tab as 动态 / 動態, matching `detail.activity`. Values only: no key is added, renamed or removed.

‎ui/packages/components/src/renderers/layout/containers.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const KNOWN_LABEL_DICT: Record<string, Record<string, string>> = {
188188
'zh-CN': {
189189
Details: '详情',
190190
Related: '相关',
191-
Activity: '活动',
191+
Activity: '动态',
192192
History: '历史',
193193
Notes: '备注',
194194
Files: '文件',
@@ -221,7 +221,7 @@ const KNOWN_LABEL_DICT: Record<string, Record<string, string>> = {
221221
Related: '相關',
222222
Timeline: '時間線',
223223
'Activity stream': '動態',
224-
Activity: '活動',
224+
Activity: '動態',
225225
History: '歷史',
226226
Notes: '備註',
227227
Files: '檔案',
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* objectstack#36148 — the record timeline's events chip has its own name, and
3+
* the Chinese stream says 动态, never 活动 (ruling 7074372050, option A).
4+
*
5+
* The 动态 tab's chips read 全部 · 事件 · 讨论 · 变更. 活动 is left to the app:
6+
* a CRM object named 活动 (meetings and calls) sits in the same tab row, and the
7+
* chip, the panel's one empty state and the stream's title used to say it too.
8+
* The events chip also differs from the tab word in every pack, so no pack names
9+
* the whole stream and one of its subsets with one word, and it never takes the
10+
* field-history chip's word (变更 / Changes, ruling 6649643659 on #30074).
11+
*
12+
* Values only: the keys are the ones the timeline already reads.
13+
*/
14+
import { describe, it, expect } from 'vitest';
15+
import { builtInLocales } from '../locales';
16+
17+
type Pack = Record<string, unknown>;
18+
19+
const detail = (locale: string): Record<string, string> =>
20+
(builtInLocales[locale as keyof typeof builtInLocales] as unknown as Record<string, Pack>).detail as Record<
21+
string,
22+
string
23+
>;
24+
25+
/** The detail keys the record timeline's stream draws (its title, chips, empty and failure states). */
26+
const STREAM_KEYS = [
27+
'activity',
28+
'timeline',
29+
'allActivity',
30+
'streamAll',
31+
'streamActivity',
32+
'streamDiscussion',
33+
'streamChanges',
34+
'noActivity',
35+
'activityAccessDenied',
36+
'activityLoadFailed',
37+
'filterActivity',
38+
] as const;
39+
40+
const CHINESE = [
41+
{ locale: 'zh-Hans', stream: '动态', events: '事件', empty: '暂无动态', banned: '活动' },
42+
{ locale: 'zh-Hant', stream: '動態', events: '事件', empty: '暫無動態', banned: '活動' },
43+
] as const;
44+
45+
describe('the record timeline says 动态, and its events chip 事件 (objectstack#36148)', () => {
46+
describe.each(CHINESE)('$locale', ({ locale, stream, events, empty, banned }) => {
47+
const pack = detail(locale);
48+
49+
it(`no string the stream draws says ${banned}`, () => {
50+
const drawn = STREAM_KEYS.map((key) => [key, pack[key]] as const);
51+
expect(drawn.every(([, value]) => typeof value === 'string' && value.length > 0)).toBe(true);
52+
expect(drawn.filter(([, value]) => value.includes(banned))).toEqual([]);
53+
});
54+
55+
it(`the chip reads ${events}, the empty state ${empty}, the title ${stream}`, () => {
56+
expect(pack.streamActivity).toBe(events);
57+
expect(pack.noActivity).toBe(empty);
58+
expect(pack.activity).toBe(stream);
59+
expect(pack.timeline).toBe(stream);
60+
});
61+
});
62+
63+
it('en names the chip Events', () => {
64+
expect(detail('en').streamActivity).toBe('Events');
65+
});
66+
67+
describe.each(Object.keys(builtInLocales))('%s', (locale) => {
68+
const pack = detail(locale);
69+
70+
it('the events chip differs from the tab, the stream title and the field-history chip', () => {
71+
expect(pack.streamActivity).toBeTruthy();
72+
expect(pack.streamActivity).not.toBe(pack.timeline);
73+
expect(pack.streamActivity).not.toBe(pack.activity);
74+
expect(pack.streamActivity).not.toBe(pack.streamChanges);
75+
});
76+
});
77+
});

‎ui/packages/i18n/src/locales/ar.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ const ar = {
18281828
recordTabsHidden: "مخفية",
18291829
bodyTableTotals: "المجاميع (هذه الصفحة)",
18301830
streamAll: "الكل",
1831-
streamActivity: "النشاط",
1831+
streamActivity: "الأحداث",
18321832
streamDiscussion: "المناقشة",
18331833
streamChanges: "التغييرات",
18341834
viewAllEntries: "عرض الكل ({{count}}) →",

‎ui/packages/i18n/src/locales/de.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ const de = {
16191619
recordTabsHidden: "Ausgeblendet",
16201620
bodyTableTotals: "Summen (diese Seite)",
16211621
streamAll: "Alle",
1622-
streamActivity: "Aktivität",
1622+
streamActivity: "Ereignisse",
16231623
streamDiscussion: "Diskussion",
16241624
streamChanges: "Änderungen",
16251625
viewAllEntries: "Alle {{count}} anzeigen →",

‎ui/packages/i18n/src/locales/en.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ const en = {
18211821
recordTabsHidden: 'Hidden',
18221822
bodyTableTotals: 'Totals (this page)',
18231823
streamAll: 'All',
1824-
streamActivity: 'Activity',
1824+
streamActivity: 'Events',
18251825
streamDiscussion: 'Discussion',
18261826
streamChanges: 'Changes',
18271827
viewAllEntries: 'View all {{count}} →',

‎ui/packages/i18n/src/locales/es.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ const es = {
16711671
recordTabsHidden: "Ocultas",
16721672
bodyTableTotals: "Totales (esta página)",
16731673
streamAll: "Todo",
1674-
streamActivity: "Actividad",
1674+
streamActivity: "Eventos",
16751675
streamDiscussion: "Discusión",
16761676
streamChanges: "Cambios",
16771677
viewAllEntries: "Ver los {{count}} →",

‎ui/packages/i18n/src/locales/fr.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ const fr = {
16741674
recordTabsHidden: "Masqués",
16751675
bodyTableTotals: "Totaux (cette page)",
16761676
streamAll: "Tout",
1677-
streamActivity: "Activité",
1677+
streamActivity: "Événements",
16781678
streamDiscussion: "Discussion",
16791679
streamChanges: "Modifications",
16801680
viewAllEntries: "Tout voir ({{count}}) →",

‎ui/packages/i18n/src/locales/ja.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ const ja = {
14181418
recordTabsHidden: "非表示",
14191419
bodyTableTotals: "合計(このページ)",
14201420
streamAll: "すべて",
1421-
streamActivity: "アクティビティ",
1421+
streamActivity: "イベント",
14221422
streamDiscussion: "ディスカッション",
14231423
streamChanges: "変更",
14241424
viewAllEntries: "すべて表示({{count}} 件)→",

‎ui/packages/i18n/src/locales/ko.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ const ko = {
16191619
recordTabsHidden: "숨김",
16201620
bodyTableTotals: "합계(이 페이지)",
16211621
streamAll: "전체",
1622-
streamActivity: "활동",
1622+
streamActivity: "이벤트",
16231623
streamDiscussion: "토론",
16241624
streamChanges: "변경",
16251625
viewAllEntries: "{{count}}개 모두 보기 →",

0 commit comments

Comments
 (0)