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
14 changes: 14 additions & 0 deletions .changeset/36148-timeline-events-chip-wording.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@object-ui/i18n': patch
'@object-ui/plugin-detail': patch
'@object-ui/components': patch
---

fix(i18n): the record timeline's events chip reads 事件 / Events, and the Chinese stream says 动态, never 活动

Clause-②: no
Metadata-protocol: none

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.

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.
4 changes: 2 additions & 2 deletions ui/packages/components/src/renderers/layout/containers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const KNOWN_LABEL_DICT: Record<string, Record<string, string>> = {
'zh-CN': {
Details: '详情',
Related: '相关',
Activity: '活动',
Activity: '动态',
History: '历史',
Notes: '备注',
Files: '文件',
Expand Down Expand Up @@ -221,7 +221,7 @@ const KNOWN_LABEL_DICT: Record<string, Record<string, string>> = {
Related: '相關',
Timeline: '時間線',
'Activity stream': '動態',
Activity: '活動',
Activity: '動態',
History: '歷史',
Notes: '備註',
Files: '檔案',
Expand Down
77 changes: 77 additions & 0 deletions ui/packages/i18n/src/__tests__/timelineFilterWording-36148.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* objectstack#36148 — the record timeline's events chip has its own name, and
* the Chinese stream says 动态, never 活动 (ruling 7074372050, option A).
*
* The 动态 tab's chips read 全部 · 事件 · 讨论 · 变更. 活动 is left to the app:
* a CRM object named 活动 (meetings and calls) sits in the same tab row, and the
* chip, the panel's one empty state and the stream's title used to say it too.
* The events chip also differs from the tab word in every pack, so no pack names
* the whole stream and one of its subsets with one word, and it never takes the
* field-history chip's word (变更 / Changes, ruling 6649643659 on #30074).
*
* Values only: the keys are the ones the timeline already reads.
*/
import { describe, it, expect } from 'vitest';
import { builtInLocales } from '../locales';

type Pack = Record<string, unknown>;

const detail = (locale: string): Record<string, string> =>
(builtInLocales[locale as keyof typeof builtInLocales] as unknown as Record<string, Pack>).detail as Record<
string,
string
>;

/** The detail keys the record timeline's stream draws (its title, chips, empty and failure states). */
const STREAM_KEYS = [
'activity',
'timeline',
'allActivity',
'streamAll',
'streamActivity',
'streamDiscussion',
'streamChanges',
'noActivity',
'activityAccessDenied',
'activityLoadFailed',
'filterActivity',
] as const;

const CHINESE = [
{ locale: 'zh-Hans', stream: '动态', events: '事件', empty: '暂无动态', banned: '活动' },
{ locale: 'zh-Hant', stream: '動態', events: '事件', empty: '暫無動態', banned: '活動' },
] as const;

describe('the record timeline says 动态, and its events chip 事件 (objectstack#36148)', () => {
describe.each(CHINESE)('$locale', ({ locale, stream, events, empty, banned }) => {
const pack = detail(locale);

it(`no string the stream draws says ${banned}`, () => {
const drawn = STREAM_KEYS.map((key) => [key, pack[key]] as const);
expect(drawn.every(([, value]) => typeof value === 'string' && value.length > 0)).toBe(true);
expect(drawn.filter(([, value]) => value.includes(banned))).toEqual([]);
});

it(`the chip reads ${events}, the empty state ${empty}, the title ${stream}`, () => {
expect(pack.streamActivity).toBe(events);
expect(pack.noActivity).toBe(empty);
expect(pack.activity).toBe(stream);
expect(pack.timeline).toBe(stream);
});
});

it('en names the chip Events', () => {
expect(detail('en').streamActivity).toBe('Events');
});

describe.each(Object.keys(builtInLocales))('%s', (locale) => {
const pack = detail(locale);

it('the events chip differs from the tab, the stream title and the field-history chip', () => {
expect(pack.streamActivity).toBeTruthy();
expect(pack.streamActivity).not.toBe(pack.timeline);
expect(pack.streamActivity).not.toBe(pack.activity);
expect(pack.streamActivity).not.toBe(pack.streamChanges);
});
});
});
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ const ar = {
recordTabsHidden: "مخفية",
bodyTableTotals: "المجاميع (هذه الصفحة)",
streamAll: "الكل",
streamActivity: "النشاط",
streamActivity: "الأحداث",
streamDiscussion: "المناقشة",
streamChanges: "التغييرات",
viewAllEntries: "عرض الكل ({{count}}) →",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ const de = {
recordTabsHidden: "Ausgeblendet",
bodyTableTotals: "Summen (diese Seite)",
streamAll: "Alle",
streamActivity: "Aktivität",
streamActivity: "Ereignisse",
streamDiscussion: "Diskussion",
streamChanges: "Änderungen",
viewAllEntries: "Alle {{count}} anzeigen →",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ const en = {
recordTabsHidden: 'Hidden',
bodyTableTotals: 'Totals (this page)',
streamAll: 'All',
streamActivity: 'Activity',
streamActivity: 'Events',
streamDiscussion: 'Discussion',
streamChanges: 'Changes',
viewAllEntries: 'View all {{count}} →',
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ const es = {
recordTabsHidden: "Ocultas",
bodyTableTotals: "Totales (esta página)",
streamAll: "Todo",
streamActivity: "Actividad",
streamActivity: "Eventos",
streamDiscussion: "Discusión",
streamChanges: "Cambios",
viewAllEntries: "Ver los {{count}} →",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ const fr = {
recordTabsHidden: "Masqués",
bodyTableTotals: "Totaux (cette page)",
streamAll: "Tout",
streamActivity: "Activité",
streamActivity: "Événements",
streamDiscussion: "Discussion",
streamChanges: "Modifications",
viewAllEntries: "Tout voir ({{count}}) →",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ const ja = {
recordTabsHidden: "非表示",
bodyTableTotals: "合計(このページ)",
streamAll: "すべて",
streamActivity: "アクティビティ",
streamActivity: "イベント",
streamDiscussion: "ディスカッション",
streamChanges: "変更",
viewAllEntries: "すべて表示({{count}} 件)→",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ const ko = {
recordTabsHidden: "숨김",
bodyTableTotals: "합계(이 페이지)",
streamAll: "전체",
streamActivity: "활동",
streamActivity: "이벤트",
streamDiscussion: "토론",
streamChanges: "변경",
viewAllEntries: "{{count}}개 모두 보기 →",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ const pt = {
recordTabsHidden: "Ocultas",
bodyTableTotals: "Totais (esta página)",
streamAll: "Tudo",
streamActivity: "Atividade",
streamActivity: "Eventos",
streamDiscussion: "Discussão",
streamChanges: "Alterações",
viewAllEntries: "Ver todos ({{count}}) →",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ const ru = {
recordTabsHidden: "Скрытые",
bodyTableTotals: "Итоги (эта страница)",
streamAll: "Все",
streamActivity: "Активность",
streamActivity: "События",
streamDiscussion: "Обсуждение",
streamChanges: "Изменения",
viewAllEntries: "Показать все ({{count}}) →",
Expand Down
12 changes: 6 additions & 6 deletions ui/packages/i18n/src/locales/zh-Hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ const zh = {
viewAll: '查看全部',
new: '新建',
add: '添加',
activity: '活动',
activity: '动态',
// objectstack#27524 — 动态 (was 时间线), the record page's stream: its
// panel, its tab and the strip's label; the right column's ⊟, and the
// 动态 panel's one-line composer.
Expand Down Expand Up @@ -1519,7 +1519,7 @@ const zh = {
recordTabsHidden: '已隐藏',
bodyTableTotals: '本页合计',
streamAll: '全部',
streamActivity: '活动',
streamActivity: '事件',
streamDiscussion: '讨论',
streamChanges: '变更',
viewAllEntries: '查看全部 {{count}} 条 →',
Expand Down Expand Up @@ -1656,10 +1656,10 @@ const zh = {
fieldChangesFilter: '字段变更',
tasksOnly: '仅任务',
leaveCommentPlaceholder: '留下评论… (Ctrl+Enter 提交)',
noActivity: '暂无活动记录',
activityAccessDenied: '您没有查看此记录活动的权限。',
noActivity: '暂无动态',
activityAccessDenied: '您没有查看此记录动态的权限。',
commentsAccessDenied: '您没有查看此记录评论的权限。',
activityLoadFailed: '无法加载此记录的活动。',
activityLoadFailed: '无法加载此记录的动态。',
commentsLoadFailed: '无法加载此记录的评论。',
retryLoadFeed: '重试',
// objectui#7149 — the rest of `ActivityTimeline`. The four chip labels the
Expand Down Expand Up @@ -1695,7 +1695,7 @@ const zh = {
replyCount_other: '{{count}} 条回复',
replyPlaceholder: '回复…',
// 无障碍标签
filterActivity: '筛选活动',
filterActivity: '筛选动态',
openDiscussion: '打开讨论面板',
closeDiscussion: '关闭讨论面板',
subscribeAriaLabel: '订阅通知',
Expand Down
12 changes: 6 additions & 6 deletions ui/packages/i18n/src/locales/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ const zhHant = {
viewAll: '檢視全部',
new: '新建',
add: '新增',
activity: '活動',
activity: '動態',
// objectstack#27524 — 動態 (was 時間線), the record page's stream: its
// panel, its tab and the strip's label; the right column's ⊟, and the
// 動態 panel's one-line composer.
Expand Down Expand Up @@ -1519,7 +1519,7 @@ const zhHant = {
recordTabsHidden: '已隱藏',
bodyTableTotals: '本頁合計',
streamAll: '全部',
streamActivity: '活動',
streamActivity: '事件',
streamDiscussion: '討論',
streamChanges: '變更',
viewAllEntries: '檢視全部 {{count}} 條 →',
Expand Down Expand Up @@ -1656,10 +1656,10 @@ const zhHant = {
fieldChangesFilter: '欄位變更',
tasksOnly: '僅任務',
leaveCommentPlaceholder: '留下評論… (Ctrl+Enter 提交)',
noActivity: '暫無活動記錄',
activityAccessDenied: '您沒有檢視此記錄活動的權限。',
noActivity: '暫無動態',
activityAccessDenied: '您沒有檢視此記錄動態的權限。',
commentsAccessDenied: '您沒有檢視此記錄評論的權限。',
activityLoadFailed: '無法載入此記錄的活動。',
activityLoadFailed: '無法載入此記錄的動態。',
commentsLoadFailed: '無法載入此記錄的評論。',
retryLoadFeed: '重試',
// objectui#7149 — the rest of `ActivityTimeline`. The four chip labels the
Expand Down Expand Up @@ -1695,7 +1695,7 @@ const zhHant = {
replyCount_other: '{{count}} 條回覆',
replyPlaceholder: '回覆…',
// 無障礙標籤
filterActivity: '篩選活動',
filterActivity: '篩選動態',
openDiscussion: '開啟討論面板',
closeDiscussion: '關閉討論面板',
subscribeAriaLabel: '訂閱通知',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ afterEach(() => cleanup());

/** The pack values for `detail.noActivity`, read from the packs themselves. */
const EN = 'No activity recorded';
const ZH = '暂无活动记录';
const ZH = '暂无动态';
const AR = 'لا يوجد نشاط مسجل';
const RAW_KEY = 'detail.noActivity';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('objectui#7149 — relative timestamps resolve from the packs', () => {
describe('objectui#7149 — the Activity card title resolves from the packs', () => {
it('titles the card in zh, ja and ar', () => {
for (const [lang, word] of [
['zh', '活动'],
['zh', '动态'],
['ja', 'アクティビティ'],
['ar', 'النشاط'],
] as const) {
Expand All @@ -147,7 +147,7 @@ describe('objectui#7149 — the Activity card title resolves from the packs', ()
// The exact string the card recorded as the visible half-done state:
// `"Activity(0)暂无活动记录"`. It is now Chinese end to end.
const { container } = renderIn('zh', []);
expect(container.textContent).toBe('活动(0)暂无活动记录');
expect(container.textContent).toBe('动态(0)暂无动态');
});
});

Expand Down Expand Up @@ -233,7 +233,7 @@ describe('objectui#7149 — filter chips and the group aria-label (published-exp
// English copy change ("Activity type filter" -> "Filter activity") so one
// control does not carry two names across two components; see the PR.
renderIn('zh', [entry({})], true);
expect(screen.getByRole('group', { name: '筛选活动' })).toBeTruthy();
expect(screen.getByRole('group', { name: '筛选动态' })).toBeTruthy();
cleanup();

renderIn('ar', [entry({})], true);
Expand Down
6 changes: 3 additions & 3 deletions ui/packages/plugin-detail/src/RecordActivityTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export interface RecordActivityTimelineProps {
onRetryFeed?: () => void;
/**
* objectstack#27055, Target 3 — `stream` is the record page's 动态 stream
* in full (the 动态 tab): the filter chips 全部 / 活动 / 讨论 / 变更 on the
* in full (the 动态 tab): the filter chips 全部 / 事件 / 讨论 / 变更 on the
* title row instead of the dropdown, system entries (field changes, system
* events) as one compact muted line each, and paging at the foot.
* objectstack#27524, Target 5 — `peek` is the body of the 动态 panel, the
Expand All @@ -192,7 +192,7 @@ export interface RecordActivityTimelineProps {
className?: string;
}

/** The stream chips' copy (objectstack#27055): 全部 / 活动 / 讨论 / 变更. */
/** The stream chips' copy (objectstack#27055): 全部 / 事件 / 讨论 / 变更. */
/** A comment's avatar cell: the author's 20 px avatar, centred on its first line. */
const COMMENT_AVATAR_CELL = 'shrink-0 flex h-[30px] w-5 items-center justify-center';
/** A comment's header line: who, then when, 30 px tall, wrapping between pieces. */
Expand All @@ -206,7 +206,7 @@ const ROW_ACTIONS_REVEAL =

const STREAM_FILTER_KEYS: Record<TimelineStreamFilter, { key: string; fallback: string }> = {
all: { key: 'detail.streamAll', fallback: 'All' },
activity: { key: 'detail.streamActivity', fallback: 'Activity' },
activity: { key: 'detail.streamActivity', fallback: 'Events' },
discussion: { key: 'detail.streamDiscussion', fallback: 'Discussion' },
changes: { key: 'detail.streamChanges', fallback: 'Changes' },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('record-detail landmark names (objectui#4645)', () => {
});

it.each([
['zh', '活动'],
['zh', '动态'],
['ja', 'アクティビティ'],
['es', 'Actividad'],
['de', 'Aktivität'],
Expand Down
8 changes: 4 additions & 4 deletions ui/packages/plugin-detail/src/recordTimelineStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* `trackHistory`), which the host hands over through
* {@link RecordFieldChangesContext}. This module is the pure part: the audit
* rows as feed items, the merge (newest first, one action one row), and
* the four filter chips 全部 / 活动 / 讨论 / 变更 (变更 = the audit's field
* changes; every activity row is 活动).
* the four filter chips 全部 / 事件 / 讨论 / 变更 (变更 = the audit's field
* changes; every activity row is 事件).
*/

import * as React from 'react';
Expand Down Expand Up @@ -293,7 +293,7 @@ function pairedStream(
return [...base, ...unpaired];
}

/** The stream's filter chips: 全部 / 活动 / 讨论 / 变更. */
/** The stream's filter chips: 全部 / 事件 / 讨论 / 变更. */
export type TimelineStreamFilter = 'all' | 'activity' | 'discussion' | 'changes';

export const TIMELINE_STREAM_FILTERS: readonly TimelineStreamFilter[] = ['all', 'activity', 'discussion', 'changes'];
Expand Down Expand Up @@ -328,7 +328,7 @@ export function isSystemStreamEntry(item: FeedItem): boolean {
* `changes_only`, hold these and nothing else (objectstack#30074, ruling C).
* An activity row (`created` / `updated` / `deleted` / `assigned` / `shared`)
* shares the `field_change` presentation but is an event, so it is judged by
* its source and sits under 活动, whatever the history flag.
* its source and sits under 事件, whatever the history flag.
*/
export function isFieldHistoryEntry(item: FeedItem): boolean {
return item.type === 'field_change' && item.source === 'sys_audit_log';
Expand Down
Loading