From d863192a0092356bffcbef852998af6d1aa72c60 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 09:01:20 +0000 Subject: [PATCH 1/4] =?UTF-8?q?fix(i18n):=20approval=20rejection=20reads?= =?UTF-8?q?=20=E9=A9=B3=E5=9B=9E=20on=20the=20zh=20runtime=20surfaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The approvals inbox, the record approval bar, the history timeline, the sys_approval_request reject lever and status, the sys_approval_action reject row and the email action-link pages now say 驳回 (zh-Hant 駁回), the word the flow designer and the server notifications already use. 拒绝 stays for access denial, invitations and AI tool approvals. Display text only: the stored `rejected` status and the `reject` action key do not change. Claude-Session: https://claude.ai/code/session_01JQwxbXBffgVtUPBEY2nLFm Co-authored-by: Claude --- .../plugin-approvals/src/action-link-pages.ts | 6 +- .../src/approval-reject-wording-35021.test.ts | 88 +++++++++++++++++++ .../approval-status-vocabulary.test.ts | 4 +- .../translations/zh-CN.objects.generated.ts | 10 +-- .../approval-reject-wording-35021.test.ts | 73 +++++++++++++++ .../approvalOverride-zh-wording-13402.test.ts | 7 +- ui/packages/i18n/src/locales/zh-Hans.ts | 42 ++++----- ui/packages/i18n/src/locales/zh-Hant.ts | 42 ++++----- 8 files changed, 218 insertions(+), 54 deletions(-) create mode 100644 packages/plugins/plugin-approvals/src/approval-reject-wording-35021.test.ts create mode 100644 ui/packages/i18n/src/__tests__/approval-reject-wording-35021.test.ts diff --git a/packages/plugins/plugin-approvals/src/action-link-pages.ts b/packages/plugins/plugin-approvals/src/action-link-pages.ts index b3aebf46c71..ad2784f26cc 100644 --- a/packages/plugins/plugin-approvals/src/action-link-pages.ts +++ b/packages/plugins/plugin-approvals/src/action-link-pages.ts @@ -85,10 +85,10 @@ export function renderConfirmPage(input: { actPath: string; }): string { const approving = input.action === 'approve'; - const verb = approving ? 'Approve · 通过' : 'Reject · 拒绝'; + const verb = approving ? 'Approve · 通过' : 'Reject · 驳回'; return shell(`${verb} — Approval`, `

${approving ? '✅ Approve this request?' : '⛔ Reject this request?'}

-

${approving ? '确认通过该审批请求?' : '确认拒绝该审批请求?'} +

${approving ? '确认通过该审批请求?' : '确认驳回该审批请求?'} Acting as · 操作身份:${esc(input.approverId)}

${summaryRows(input.request)}
@@ -100,7 +100,7 @@ export function renderConfirmPage(input: { const RESULT_COPY: Record = { approved: { cls: 'ok', title: '✅ Approved · 已通过', body: 'The decision was recorded. · 审批结果已记录。' }, - rejected: { cls: 'ok', title: '⛔ Rejected · 已拒绝', body: 'The decision was recorded. · 审批结果已记录。' }, + rejected: { cls: 'ok', title: '⛔ Rejected · 已驳回', body: 'The decision was recorded. · 审批结果已记录。' }, invalid: { cls: 'err', title: 'Invalid link · 链接无效', body: 'This link is not recognized. · 无法识别该链接。' }, expired: { cls: 'warn', title: 'Link expired · 链接已过期', body: 'Ask the requester to send a new reminder. · 请让申请人重新发送催办。' }, consumed: { cls: 'warn', title: 'Already used · 链接已使用', body: 'This link was already used once. · 该链接已被使用过。' }, diff --git a/packages/plugins/plugin-approvals/src/approval-reject-wording-35021.test.ts b/packages/plugins/plugin-approvals/src/approval-reject-wording-35021.test.ts new file mode 100644 index 00000000000..ed99f01ad63 --- /dev/null +++ b/packages/plugins/plugin-approvals/src/approval-reject-wording-35021.test.ts @@ -0,0 +1,88 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. +// +// Approval-rejection wording pin (#35021, ruling 6973602227, option A). +// +// In Chinese an approval rejection reads 驳回 (zh-Hant 駁回): the record-page +// lever this plugin declares (`approval_reject`), its confirm question and +// success toast, the `rejected` status, the `reject` row of the action history, +// and the email action-link confirm and result pages. The flow designer's +// approval branch and the server notifications (`./translations/messages.ts`) +// already say it, so every surface names one decision with one word. The +// stored values (`rejected`, `reject`) are not display text and do not change. +// +// The labels are read through the real resolvers, so the cases also prove the +// bundles are REACHED: the declared labels are English, and 驳回 can only come +// from a bundle. + +import { describe, it, expect } from 'vitest'; +import { translateObject, translateMetadataDocument } from '@objectstack/spec/system'; + +import { ApprovalsTranslations } from './translations/index.js'; +import { zhCNObjects } from './translations/zh-CN.objects.generated.js'; +import { zhHantObjects } from './translations/zh-Hant.objects.generated.js'; +import { SysApprovalRequest } from './sys-approval-request.object.js'; +import { SysApprovalAction } from './sys-approval-action.object.js'; +import { renderConfirmPage, renderResultPage } from './action-link-pages.js'; + +const LOCALES = [ + { locale: 'zh-CN', bundle: zhCNObjects, reject: '驳回', deny: '拒绝' }, + { locale: 'zh-Hant', bundle: zhHantObjects, reject: '駁回', deny: '拒絕' }, +] as const; + +const optionLabel = (object: unknown, field: string, value: string, locale: string): string | undefined => { + const doc = translateObject(object as any, ApprovalsTranslations, { locale }); + const options = (doc as any)?.fields?.[field]?.options as Array<{ value: string; label?: string }> | undefined; + return options?.find((o) => o.value === value)?.label; +}; + +const servedAction = (locale: string, name: string): Record | undefined => { + const doc = translateMetadataDocument('object', SysApprovalRequest, ApprovalsTranslations, { locale }); + return ((doc as { actions?: Array> }).actions ?? []).find((a) => a.name === name); +}; + +/** Every string leaf of a bundle subtree, with its dotted path. */ +const leaves = (node: unknown, path: string[] = []): Array<[string, string]> => { + if (typeof node === 'string') return [[path.join('.'), node]]; + if (!node || typeof node !== 'object') return []; + return Object.entries(node).flatMap(([key, child]) => leaves(child, [...path, key])); +}; + +describe('approval rejection reads 驳回 (#35021)', () => { + describe.each(LOCALES)('$locale', ({ locale, bundle, reject, deny }) => { + it(`the reject lever, the rejected status and the reject history row read ${reject}`, () => { + expect(servedAction(locale, 'approval_reject')?.label).toBe(reject); + expect(optionLabel(SysApprovalRequest, 'status', 'rejected', locale)).toBe(`已${reject}`); + expect(optionLabel(SysApprovalAction, 'action', 'reject', locale)).toBe(reject); + }); + + it(`the reject lever's question and success toast say ${reject}`, () => { + const node = (bundle as any).sys_approval_request._actions.approval_reject; + expect(node.description).toContain(reject); + expect(node.successMessage).toContain(reject); + }); + + it(`no approval object string in the bundle says ${deny}`, () => { + const all = [ + ...leaves((bundle as any).sys_approval_request, ['sys_approval_request']), + ...leaves((bundle as any).sys_approval_action, ['sys_approval_action']), + ]; + expect(all.length).toBeGreaterThan(0); + expect(all.filter(([, value]) => value.includes(deny))).toEqual([]); + }); + }); + + it('the email action-link pages say 驳回 for the reject decision', () => { + const request = { id: 'req_1', record_id: 'rec_1', object_name: 'expense', process_name: 'p' } as any; + const confirm = renderConfirmPage({ + request, + action: 'reject', + approverId: 'user_1', + token: 'tok', + actPath: '/act', + }); + const result = renderResultPage('rejected', request); + expect(confirm).toContain('驳回'); + expect(result).toContain('已驳回'); + expect([confirm, result].filter((page) => page.includes('拒绝'))).toEqual([]); + }); +}); diff --git a/packages/plugins/plugin-approvals/src/translations/approval-status-vocabulary.test.ts b/packages/plugins/plugin-approvals/src/translations/approval-status-vocabulary.test.ts index 26a781ad008..57012c016ce 100644 --- a/packages/plugins/plugin-approvals/src/translations/approval-status-vocabulary.test.ts +++ b/packages/plugins/plugin-approvals/src/translations/approval-status-vocabulary.test.ts @@ -100,7 +100,9 @@ describe('approval status vocabulary (#7232)', () => { expect(resolvedStatusLabels('zh-CN')).toEqual({ pending: '待审批', approved: '已批准', - rejected: '已拒绝', + // #35021: an approval rejection reads 驳回, the flow designer's word for + // the branch; 拒绝 is left to access denial and invitations. + rejected: '已驳回', recalled: '已撤回', returned: '已退回修改', // #13568. 已作废, deliberately not 已取消: `recalled` is already 已撤回 diff --git a/packages/plugins/plugin-approvals/src/translations/zh-CN.objects.generated.ts b/packages/plugins/plugin-approvals/src/translations/zh-CN.objects.generated.ts index 0bc0ce631da..05702c5772e 100644 --- a/packages/plugins/plugin-approvals/src/translations/zh-CN.objects.generated.ts +++ b/packages/plugins/plugin-approvals/src/translations/zh-CN.objects.generated.ts @@ -61,7 +61,7 @@ export const zhCNObjects: NonNullable = { options: { pending: "待审批", approved: "已批准", - rejected: "已拒绝", + rejected: "已驳回", recalled: "已撤回", returned: "已退回修改", cancelled: "已作废" @@ -152,9 +152,9 @@ export const zhCNObjects: NonNullable = { } }, approval_reject: { - label: "拒绝", - description: "拒绝该请求?拒绝对所有审批人立即生效。", - successMessage: "已拒绝“{{ result.request.record_title }}”", + label: "驳回", + description: "驳回该请求?驳回对所有审批人立即生效。", + successMessage: "已驳回“{{ result.request.record_title }}”", params: { comment: { label: "审批意见" @@ -280,7 +280,7 @@ export const zhCNObjects: NonNullable = { options: { submit: "提交", approve: "批准", - reject: "拒绝", + reject: "驳回", recall: "撤回", escalate: "升级", reassign: "转签", diff --git a/ui/packages/i18n/src/__tests__/approval-reject-wording-35021.test.ts b/ui/packages/i18n/src/__tests__/approval-reject-wording-35021.test.ts new file mode 100644 index 00000000000..12b6ae83b3c --- /dev/null +++ b/ui/packages/i18n/src/__tests__/approval-reject-wording-35021.test.ts @@ -0,0 +1,73 @@ +/** + * objectstack#35021 — an approval rejection reads 驳回 in Chinese, on the + * runtime surfaces as in the designer (ruling 6973602227, option A). + * + * The inbox, the record approval bar and the history timeline name the reject + * decision with the word the flow designer gives the approval branch, in + * zh-Hans and zh-Hant. 拒绝 keeps its own meanings: access denial, declining an + * invitation, and the AI tool approvals (`aiApprovals`), a different concept. + * + * What is pinned is the vocabulary, not the sentences: no `approvalsInbox` + * string in either Chinese pack says 拒绝, every key named for the reject + * decision says 驳回, and the runtime's decision word and status agree with the + * designer's branch and end-node labels. Each enumeration asserts it is + * non-empty first, so a family that stopped resolving cannot pass with + * nothing checked. + */ +import { describe, it, expect } from 'vitest'; +import { builtInLocales } from '../locales'; +import STUDIO_ZH from '../namespaces/studio/zh.js'; + +type Pack = Record; + +const group = (locale: 'zh-Hans' | 'zh-Hant', name: string): Pack => + (builtInLocales[locale] as unknown as Record)[name]; + +const strings = (pack: Pack): Array<[string, string]> => + Object.entries(pack).filter((entry): entry is [string, string] => typeof entry[1] === 'string'); + +const SCRIPTS = [ + { locale: 'zh-Hans', reject: '驳回', deny: '拒绝' }, + { locale: 'zh-Hant', reject: '駁回', deny: '拒絕' }, +] as const; + +describe('approval rejection reads 驳回 on the runtime surfaces (objectstack#35021)', () => { + describe.each(SCRIPTS)('$locale', ({ locale, reject, deny }) => { + const inbox = group(locale, 'approvalsInbox'); + + it(`no approvalsInbox string says ${deny}`, () => { + const entries = strings(inbox); + expect(entries.length).toBeGreaterThan(0); + expect(entries.filter(([, value]) => value.includes(deny))).toEqual([]); + }); + + it(`every approvalsInbox key named for the reject decision says ${reject}`, () => { + const rejectKeys = strings(inbox).filter(([key]) => /reject/i.test(key)); + expect(rejectKeys.length).toBeGreaterThan(0); + expect(rejectKeys.filter(([, value]) => !value.includes(reject))).toEqual([]); + }); + + it(`the decision verb reads ${reject} and the status reads 已${reject}`, () => { + expect(inbox.actReject).toBe(reject); + expect(inbox.reject).toBe(reject); + expect(inbox.statusRejected).toBe(`已${reject}`); + expect(inbox.rejectedToast).toBe(`已${reject}`); + }); + + it(`access denial, invitations and AI tool approvals keep ${deny}`, () => { + const aiApprovals = group(locale, 'aiApprovals'); + expect(aiApprovals.reject).toBe(deny); + expect(aiApprovals.statusRejected).toBe(`已${deny}`); + const organization = group(locale, 'organization') as Record; + expect((organization.invitations.status as Pack).rejected).toBe(`已${deny}`); + expect(organization.accept.decline).toBe(deny); + expect(String(group(locale, 'errors').forbidden)).toContain(deny); + }); + }); + + it('the runtime decision word agrees with the designer branch and end node', () => { + const inbox = group('zh-Hans', 'approvalsInbox'); + expect(inbox.actReject).toBe(STUDIO_ZH['engine.inspector.flowEdge.branchReject']); + expect(inbox.statusRejected).toBe(STUDIO_ZH['engine.flowCanvas.rejectedEnd']); + }); +}); diff --git a/ui/packages/i18n/src/__tests__/approvalOverride-zh-wording-13402.test.ts b/ui/packages/i18n/src/__tests__/approvalOverride-zh-wording-13402.test.ts index d53c271944b..6b29c380b55 100644 --- a/ui/packages/i18n/src/__tests__/approvalOverride-zh-wording-13402.test.ts +++ b/ui/packages/i18n/src/__tests__/approvalOverride-zh-wording-13402.test.ts @@ -46,10 +46,11 @@ describe('zh admin-override copy names an authorized override, not a violation ( it('the override lever and the history chip read 管理员代为〈action〉 and 管理员代办', () => { expect(zh.overrideActionLabel).toBe('管理员代为{{action}}'); expect(zh.viaOverrideChip).toBe('管理员代办'); - // `{{action}}` is the lever's declared, localized label. + // `{{action}}` is the lever's declared, localized label; the reject lever + // reads 驳回 (objectstack#35021). const label = zh.overrideActionLabel as string; - expect(['通过', '拒绝', '转签', '撤回'].map((verb) => label.replace('{{action}}', verb))) - .toEqual(['管理员代为通过', '管理员代为拒绝', '管理员代为转签', '管理员代为撤回']); + expect(['通过', '驳回', '转签', '撤回'].map((verb) => label.replace('{{action}}', verb))) + .toEqual(['管理员代为通过', '管理员代为驳回', '管理员代为转签', '管理员代为撤回']); }); it.each(OVERRIDE_KEYS)('zh %s keeps the placeholders of its en source', (key) => { diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index 26246b8372f..85ff2376377 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -4721,7 +4721,7 @@ const zh = { colActions: '操作', statusPending: '待审批', statusApproved: '已通过', - statusRejected: '已拒绝', + statusRejected: '已驳回', statusRecalled: '已撤回', statusReturned: '已退回修改', sendBackBtn: '退回修改', @@ -4729,7 +4729,7 @@ const zh = { sendBackBody: '本轮审批结束,记录解锁,申请人可修改数据。重新提交后将为所有审批人开启新一轮审批。', sendBackPlaceholder: '需要修改什么才能通过审批?', sendBackSuccess: '已退回修改——申请人现在可以编辑并重新提交', - sendBackAutoRejected: '已达退回次数上限——申请已被自动拒绝', + sendBackAutoRejected: '已达退回次数上限——申请已被自动驳回', actRevise: '退回修改', actResubmit: '重新提交', roundChip: '第 {{n}} 轮', @@ -4749,7 +4749,7 @@ const zh = { waitingOnOthers_one: '{{count}} 个申请正在等待其他审批人', waitingOnOthers_other: '{{count}} 个申请正在等待其他审批人', noMatches: '没有符合当前筛选条件的请求。', - keyboardHint: '快捷键:j/k 移动 · Enter 打开 · x 选择 · a 通过 · r 拒绝', + keyboardHint: '快捷键:j/k 移动 · Enter 打开 · x 选择 · a 通过 · r 驳回', drawerTitle: '审批请求', submittedAgo: '提交于{{when}}', completedAt: '完成于{{when}}', @@ -4760,7 +4760,7 @@ const zh = { noActions: '暂无操作记录。', actSubmit: '提交', actApprove: '通过', - actReject: '拒绝', + actReject: '驳回', actRecall: '撤回', overrideActionLabel: '管理员代为{{action}}', overrideNotice: '你在该步骤没有审批人席位。继续将以管理员身份代为处理:该步骤会立即结案,尚未表态的审批人都会被跳过。此决定将记录为管理员代办。', @@ -4778,43 +4778,43 @@ const zh = { comment: '审批意见(可选)', approve: '通过', approving: '正在通过…', - reject: '拒绝', - rejecting: '正在拒绝…', + reject: '驳回', + rejecting: '正在驳回…', recall: '撤回', recalling: '正在撤回…', cancel: '取消', clear: '清除', approveN: '通过 {{count}} 条', - rejectN: '拒绝 {{count}} 条', + rejectN: '驳回 {{count}} 条', bulkApproveTitle: '通过这 {{count}} 条请求?', bulkApproveTitle_one: '通过这 {{count}} 条请求?', bulkApproveTitle_other: '通过这 {{count}} 条请求?', bulkApproveBody: '每条请求都将以你的身份通过,对应流程沿“通过”分支继续。', - bulkRejectTitle: '拒绝这 {{count}} 条请求?', - bulkRejectTitle_one: '拒绝这 {{count}} 条请求?', - bulkRejectTitle_other: '拒绝这 {{count}} 条请求?', - bulkRejectBody: '将拒绝所选请求并通知各申请人。', + bulkRejectTitle: '驳回这 {{count}} 条请求?', + bulkRejectTitle_one: '驳回这 {{count}} 条请求?', + bulkRejectTitle_other: '驳回这 {{count}} 条请求?', + bulkRejectBody: '将驳回所选请求并通知各申请人。', bulkApproved: '已通过 {{count}} 条请求', bulkApproved_one: '已通过 {{count}} 条请求', bulkApproved_other: '已通过 {{count}} 条请求', - bulkRejected: '已拒绝 {{count}} 条请求', - bulkRejected_one: '已拒绝 {{count}} 条请求', - bulkRejected_other: '已拒绝 {{count}} 条请求', + bulkRejected: '已驳回 {{count}} 条请求', + bulkRejected_one: '已驳回 {{count}} 条请求', + bulkRejected_other: '已驳回 {{count}} 条请求', bulkPartial: '{{ok}} 条成功,{{fail}} 条失败:{{which}}', - rejectOneTitle: '拒绝“{{title}}”?', - rejectOneBody: '将拒绝该请求并通知申请人。', - rejectTitle: '拒绝该请求?', - rejectBody: '将把该请求标记为已拒绝,并通知申请人。', + rejectOneTitle: '驳回“{{title}}”?', + rejectOneBody: '将驳回该请求并通知申请人。', + rejectTitle: '驳回该请求?', + rejectBody: '将把该请求标记为已驳回,并通知申请人。', recallTitle: '撤回该请求?', recallBody: '撤回后审批人将无法继续处理,记录随即解锁。', inlineApproved: '已通过“{{title}}”', - inlineRejected: '已拒绝“{{title}}”', + inlineRejected: '已驳回“{{title}}”', approvedFinal: '已通过', approvedWaiting: '已通过——等待其余审批人', - rejectedToast: '已拒绝', + rejectedToast: '已驳回', recalledToast: '请求已撤回', whyDisabled: '只有指定的审批人才能处理该请求。当前等待:{{who}}。', - whyDisabledSubmitter: '这是你发起的请求,你可以撤回;但只有指定审批人才能通过或拒绝。', + whyDisabledSubmitter: '这是你发起的请求,你可以撤回;但只有指定审批人才能通过或驳回。', noActor: '无法确定操作身份', actionFailed: '操作失败', loadFailed: '加载请求失败', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index 0ad10e872f8..4af8fc36134 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -4721,7 +4721,7 @@ const zhHant = { colActions: '操作', statusPending: '待審批', statusApproved: '已通過', - statusRejected: '已拒絕', + statusRejected: '已駁回', statusRecalled: '已撤回', statusReturned: '已退回修改', sendBackBtn: '退回修改', @@ -4729,7 +4729,7 @@ const zhHant = { sendBackBody: '本輪審批結束,記錄解鎖,申請人可修改資料。重新提交後將為所有審批人開啟新一輪審批。', sendBackPlaceholder: '需要修改什麼才能通過審批?', sendBackSuccess: '已退回修改——申請人現在可以編輯並重新提交', - sendBackAutoRejected: '已達退回次數上限——申請已被自動拒絕', + sendBackAutoRejected: '已達退回次數上限——申請已被自動駁回', actRevise: '退回修改', actResubmit: '重新提交', roundChip: '第 {{n}} 輪', @@ -4749,7 +4749,7 @@ const zhHant = { waitingOnOthers_one: '{{count}} 個申請正在等待其他審批人', waitingOnOthers_other: '{{count}} 個申請正在等待其他審批人', noMatches: '沒有符合當前篩選條件的請求。', - keyboardHint: '快捷鍵:j/k 移動 · Enter 開啟 · x 選擇 · a 通過 · r 拒絕', + keyboardHint: '快捷鍵:j/k 移動 · Enter 開啟 · x 選擇 · a 通過 · r 駁回', drawerTitle: '審批請求', submittedAgo: '提交於{{when}}', completedAt: '完成於{{when}}', @@ -4760,7 +4760,7 @@ const zhHant = { noActions: '暫無操作記錄。', actSubmit: '提交', actApprove: '通過', - actReject: '拒絕', + actReject: '駁回', actRecall: '撤回', overrideActionLabel: '管理員代為{{action}}', overrideNotice: '你在該步驟沒有審批人席位。繼續將以管理員身份代為處理:該步驟會立即結案,尚未表態的審批人都會被跳過。此決定將記錄為管理員代辦。', @@ -4778,43 +4778,43 @@ const zhHant = { comment: '審批意見(可選)', approve: '通過', approving: '正在通過…', - reject: '拒絕', - rejecting: '正在拒絕…', + reject: '駁回', + rejecting: '正在駁回…', recall: '撤回', recalling: '正在撤回…', cancel: '取消', clear: '清除', approveN: '通過 {{count}} 條', - rejectN: '拒絕 {{count}} 條', + rejectN: '駁回 {{count}} 條', bulkApproveTitle: '通過這 {{count}} 條請求?', bulkApproveTitle_one: '通過這 {{count}} 條請求?', bulkApproveTitle_other: '通過這 {{count}} 條請求?', bulkApproveBody: '每條請求都將以你的身份通過,對應流程沿“通過”分支繼續。', - bulkRejectTitle: '拒絕這 {{count}} 條請求?', - bulkRejectTitle_one: '拒絕這 {{count}} 條請求?', - bulkRejectTitle_other: '拒絕這 {{count}} 條請求?', - bulkRejectBody: '將拒絕所選請求並通知各申請人。', + bulkRejectTitle: '駁回這 {{count}} 條請求?', + bulkRejectTitle_one: '駁回這 {{count}} 條請求?', + bulkRejectTitle_other: '駁回這 {{count}} 條請求?', + bulkRejectBody: '將駁回所選請求並通知各申請人。', bulkApproved: '已通過 {{count}} 條請求', bulkApproved_one: '已通過 {{count}} 條請求', bulkApproved_other: '已通過 {{count}} 條請求', - bulkRejected: '已拒絕 {{count}} 條請求', - bulkRejected_one: '已拒絕 {{count}} 條請求', - bulkRejected_other: '已拒絕 {{count}} 條請求', + bulkRejected: '已駁回 {{count}} 條請求', + bulkRejected_one: '已駁回 {{count}} 條請求', + bulkRejected_other: '已駁回 {{count}} 條請求', bulkPartial: '{{ok}} 條成功,{{fail}} 條失敗:{{which}}', - rejectOneTitle: '拒絕“{{title}}”?', - rejectOneBody: '將拒絕該請求並通知申請人。', - rejectTitle: '拒絕該請求?', - rejectBody: '將把該請求標記為已拒絕,並通知申請人。', + rejectOneTitle: '駁回“{{title}}”?', + rejectOneBody: '將駁回該請求並通知申請人。', + rejectTitle: '駁回該請求?', + rejectBody: '將把該請求標記為已駁回,並通知申請人。', recallTitle: '撤回該請求?', recallBody: '撤回後審批人將無法繼續處理,記錄隨即解鎖。', inlineApproved: '已通過“{{title}}”', - inlineRejected: '已拒絕“{{title}}”', + inlineRejected: '已駁回“{{title}}”', approvedFinal: '已通過', approvedWaiting: '已通過——等待其餘審批人', - rejectedToast: '已拒絕', + rejectedToast: '已駁回', recalledToast: '請求已撤回', whyDisabled: '只有指定的審批人才能處理該請求。當前等待:{{who}}。', - whyDisabledSubmitter: '這是你發起的請求,你可以撤回;但只有指定審批人才能通過或拒絕。', + whyDisabledSubmitter: '這是你發起的請求,你可以撤回;但只有指定審批人才能通過或駁回。', noActor: '無法確定操作身份', actionFailed: '操作失敗', loadFailed: '載入請求失敗', From 345812c6f80a37e2939bf3b5cfa5fcd9fbd1cca3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 09:07:22 +0000 Subject: [PATCH 2/4] chore(changeset): approval rejection wording patch for plugin-approvals and i18n Claude-Session: https://claude.ai/code/session_01JQwxbXBffgVtUPBEY2nLFm Co-authored-by: Claude --- .changeset/35021-approval-reject-wording.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .changeset/35021-approval-reject-wording.md diff --git a/.changeset/35021-approval-reject-wording.md b/.changeset/35021-approval-reject-wording.md new file mode 100644 index 00000000000..cc347ca0bdb --- /dev/null +++ b/.changeset/35021-approval-reject-wording.md @@ -0,0 +1,16 @@ +--- +'@objectstack/plugin-approvals': patch +'@object-ui/i18n': patch +--- + +fix(i18n): an approval rejection reads 驳回 in Chinese on the runtime surfaces + +Clause-②: no +Metadata-protocol: none + +In Chinese, the approval runtime now names the reject decision 驳回 (zh-Hant 駁回), the word the flow designer gives the approval branch and the server notifications already use. Before, the designer said 驳回 and the approver clicked 拒绝 for the same decision. + +- `@object-ui/i18n`: the `approvalsInbox` strings in zh-Hans and zh-Hant: the inbox and record-bar buttons, the bulk and single confirm dialogs, the toasts, the status chip (已拒绝 → 已驳回), the history row, the keyboard hint and the send-back limit notice. +- `@objectstack/plugin-approvals`: the zh-CN labels of `sys_approval_request` (the `approval_reject` lever, its confirm question and success toast, the `rejected` status) and of the `reject` row of `sys_approval_action`; the zh-Hant bundle already said 駁回. The email action-link confirm and result pages read 驳回. + +拒绝 stays where it means access denial or declining an invitation, and in the AI tool approvals. Display text only: the stored `rejected` status and the `reject` action key are unchanged, and English and the other languages are untouched. From d7474f8e214903dcb81fc71d4d3c3c8996b7ec2e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 10:06:18 +0000 Subject: [PATCH 3/4] =?UTF-8?q?fix(app-shell):=20the=20approval=20node's?= =?UTF-8?q?=20zh=20designer=20help=20says=20=E9=A9=B3=E5=9B=9E=20for=20the?= =?UTF-8?q?=20reject=20decision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The multi-approver help, the status-mirror help, the escalation help and its auto_reject option label, and the revision-limit help move from 拒绝 to 驳回, the word of the approval branch and of the runtime. The auto_reject value is unchanged; the end node's refused outcome and the API-key, bulk-update and audit-outcome refusals keep 拒绝. Claude-Session: https://claude.ai/code/session_01JQwxbXBffgVtUPBEY2nLFm Co-authored-by: Claude --- .../src/views/metadata-admin/i18n.ts | 10 +-- ...config.approvalRejectWording-35021.test.ts | 64 +++++++++++++++++++ 2 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 ui/packages/app-shell/src/views/metadata-admin/inspectors/flow-node-config.approvalRejectWording-35021.test.ts diff --git a/ui/packages/app-shell/src/views/metadata-admin/i18n.ts b/ui/packages/app-shell/src/views/metadata-admin/i18n.ts index 0f9fbdfd4a7..1d3164ccb39 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/i18n.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/i18n.ts @@ -472,7 +472,7 @@ const FLOW_FIELD_ZH: Record> = { }, behavior: { label: '审批方式', - help: '多个审批人如何组合。任何一个拒绝在所有模式下都是否决。', + help: '多个审批人如何组合。任何一个驳回在所有模式下都是否决。', opts: { first_response: '首个响应生效', unanimous: '全员通过', @@ -484,7 +484,7 @@ const FLOW_FIELD_ZH: Record> = { lockRecord: { label: '锁定记录', help: '此节点待处理期间锁定触发记录,禁止编辑。' }, approvalStatusField: { label: '状态字段', - help: '将请求状态(待审 / 通过 / 拒绝)镜像到的业务对象字段。应为只读。', + help: '将请求状态(待审 / 通过 / 驳回)镜像到的业务对象字段。应为只读。', }, 'escalation.enabled': { label: 'SLA 升级', help: '在超时内未做决策时升级。' }, 'escalation.timeoutHours': { @@ -493,8 +493,8 @@ const FLOW_FIELD_ZH: Record> = { }, 'escalation.action': { label: '超时动作', - help: '超过期限后怎么办:改派给其他人、自动通过、自动拒绝,或通知某人(默认)。', - opts: { notify: '通知', reassign: '改派', auto_approve: '自动通过', auto_reject: '自动拒绝' }, + help: '超过期限后怎么办:改派给其他人、自动通过、自动驳回,或通知某人(默认)。', + opts: { notify: '通知', reassign: '改派', auto_approve: '自动通过', auto_reject: '自动驳回' }, }, 'escalation.escalateTo': { label: '升级至', @@ -504,7 +504,7 @@ const FLOW_FIELD_ZH: Record> = { 'escalation.notifySubmitter': { label: '通知提交人', help: '升级时通知提交请求的人。' }, maxRevisions: { label: '最多退回次数', - help: '请求自动拒绝前的最多退回修订次数(0 表示禁用退回)。需要一条审批分支为「退回修改」的出边才生效。', + help: '请求自动驳回前的最多退回修订次数(0 表示禁用退回)。需要一条审批分支为「退回修改」的出边才生效。', }, // objectstack#34818 — was English in the zh panel. onEmptyApprovers: { diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/flow-node-config.approvalRejectWording-35021.test.ts b/ui/packages/app-shell/src/views/metadata-admin/inspectors/flow-node-config.approvalRejectWording-35021.test.ts new file mode 100644 index 00000000000..0012a799c36 --- /dev/null +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/flow-node-config.approvalRejectWording-35021.test.ts @@ -0,0 +1,64 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#35021 — the approval node's zh panel names the reject decision + * 驳回, the word of its branch connection, of the runtime inbox and of the + * approval notifications (ruling 6973602227, option A; premise corrected + * 6975255638). The `auto_reject` value is stored metadata and stays. + * + * Every string the panel draws is enumerated, from the inspector's own field + * table and from the fields the engine serves (the contract's JSON Schema), + * and none may say 拒绝. A zh-Hant session draws the same Simplified table + * (`isZhLocale`), so it is held too. The end node's refused outcome is not an + * approval decision and keeps 已拒绝 — the control that the replacement did not + * reach past the approval node. + */ + +import { describe, expect, it } from 'vitest'; +import { z } from 'zod'; +import { ApprovalNodeConfigSchema } from '@objectstack/spec/automation'; +import { fieldsForNodeType, localizeFlowFields, type FlowConfigField } from './flow-node-config.js'; +import { jsonSchemaToFlowFields } from './json-schema-to-fields.js'; + +/** Every visible string of a field, with where it sits. */ +function strings(field: FlowConfigField): Array<[string, string]> { + const out: Array<[string, string]> = [[`${field.id}.label`, field.label]]; + if (field.help) out.push([`${field.id}.help`, field.help]); + if (field.placeholder) out.push([`${field.id}.placeholder`, field.placeholder]); + for (const o of field.options ?? []) out.push([`${field.id}.opt.${o.value}`, o.label]); + for (const c of field.columns ?? []) { + out.push([`${field.id}.col.${c.key}.label`, c.label]); + if (c.help) out.push([`${field.id}.col.${c.key}.help`, c.help]); + for (const o of c.options ?? []) out.push([`${field.id}.col.${c.key}.opt.${o.value}`, o.label]); + } + return out; +} + +const PANELS = [ + ['the inspector table', () => fieldsForNodeType('approval')], + ['the served contract', () => jsonSchemaToFlowFields(z.toJSONSchema(ApprovalNodeConfigSchema, { io: 'input' }))!], +] as const; + +describe('the approval node panel says 驳回 for the reject decision (objectstack#35021)', () => { + describe.each(['zh-CN', 'zh-Hant'])('%s', (locale) => { + it.each(PANELS)('no string of %s says 拒绝', (_name, fields) => { + const all = localizeFlowFields('approval', fields(), locale).flatMap(strings); + expect(all.length).toBeGreaterThan(0); + expect(all.filter(([, text]) => text.includes('拒绝'))).toEqual([]); + }); + + it('the reject-decision strings say 驳回, and the auto_reject value is unchanged', () => { + const byId = new Map(localizeFlowFields('approval', fieldsForNodeType('approval'), locale).map((f) => [f.id, f])); + for (const id of ['behavior', 'approvalStatusField', 'escalation.action', 'maxRevisions']) { + expect(byId.get(id)?.help, id).toContain('驳回'); + } + const autoReject = byId.get('escalation.action')?.options?.find((o) => o.value === 'auto_reject'); + expect(autoReject?.label).toBe('自动驳回'); + }); + }); + + it('control: the end node keeps 已拒绝 for its refused outcome', () => { + const outcome = localizeFlowFields('end', fieldsForNodeType('end'), 'zh-CN').find((f) => f.id === 'outcome'); + expect(outcome?.options?.find((o) => o.value === 'refused')?.label).toBe('已拒绝'); + }); +}); From c3e9590d20de6d29833d3d3550d490d07f563b7b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 10:11:52 +0000 Subject: [PATCH 4/4] chore(changeset): the approval rejection wording reaches the designer's approval panel Claude-Session: https://claude.ai/code/session_01JQwxbXBffgVtUPBEY2nLFm Co-authored-by: Claude --- .changeset/35021-approval-reject-wording.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.changeset/35021-approval-reject-wording.md b/.changeset/35021-approval-reject-wording.md index cc347ca0bdb..3cac571d588 100644 --- a/.changeset/35021-approval-reject-wording.md +++ b/.changeset/35021-approval-reject-wording.md @@ -1,16 +1,18 @@ --- '@objectstack/plugin-approvals': patch '@object-ui/i18n': patch +'@object-ui/app-shell': patch --- -fix(i18n): an approval rejection reads 驳回 in Chinese on the runtime surfaces +fix(i18n): an approval rejection reads 驳回 in Chinese, on the runtime surfaces and in the designer's approval panel Clause-②: no Metadata-protocol: none -In Chinese, the approval runtime now names the reject decision 驳回 (zh-Hant 駁回), the word the flow designer gives the approval branch and the server notifications already use. Before, the designer said 驳回 and the approver clicked 拒绝 for the same decision. +In Chinese, the approval runtime now names the reject decision 驳回 (zh-Hant 駁回), the word the flow designer gives the approval branch and the server notifications already use. Before, the designer's branch said 驳回 while its approval-node help and the approver's buttons said 拒绝 for the same decision. - `@object-ui/i18n`: the `approvalsInbox` strings in zh-Hans and zh-Hant: the inbox and record-bar buttons, the bulk and single confirm dialogs, the toasts, the status chip (已拒绝 → 已驳回), the history row, the keyboard hint and the send-back limit notice. - `@objectstack/plugin-approvals`: the zh-CN labels of `sys_approval_request` (the `approval_reject` lever, its confirm question and success toast, the `rejected` status) and of the `reject` row of `sys_approval_action`; the zh-Hant bundle already said 駁回. The email action-link confirm and result pages read 驳回. +- `@object-ui/app-shell`: the approval node's zh panel in the flow designer: the multi-approver help, the status-mirror help, the escalation help and its `auto_reject` option label (自动拒绝 → 自动驳回; the stored `auto_reject` value is unchanged), and the revision-limit help. Its branch label and Problems hint already said 驳回; a zh-Hant session draws the same Simplified table. -拒绝 stays where it means access denial or declining an invitation, and in the AI tool approvals. Display text only: the stored `rejected` status and the `reject` action key are unchanged, and English and the other languages are untouched. +拒绝 stays where it means access denial or declining an invitation, in the AI tool approvals, and in the designer's end-node refused outcome and its API-key, bulk-update and audit-outcome refusals. Display text only: the stored `rejected` status and the `reject` action key are unchanged, and English and the other languages are untouched.