Skip to content

Commit 7ed34f9

Browse files
committed
chore(example-showcase): translate the approval flows and steps the widened i18n coverage now asks for; changeset for the cli fix
`check:i18n-coverage` measured app-showcase at 437 against its baselined 414 once the extractor asked for approval flow labels and approval step labels: eight flow labels and fifteen steps, all zh-CN. They are translated here, as the gate prescribes, so the baseline stays at 414 rather than freezing new debt. Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3c73394 commit 7ed34f9

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@objectstack/cli": patch
3+
---
4+
5+
fix(cli): `os lint` and `os i18n check` ask for an approval flow's label and each approval step's label (#24916)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The approvals door names a request's flow and its current step in the reader's locale, from `flows.FLOW.label` and `flows.FLOW.approvals.NODE.label`. The i18n extractor asked for `flows.FLOW.label` only on a flow with a `screen` node, and for no approval step at all, so `i18n/missing-flow` never listed an approval flow or its steps as untranslated, and `os i18n extract` never scaffolded those keys. An app's approvals inbox could show the authoring language in every other locale under a green coverage run.
11+
12+
Now:
13+
14+
- `flows.FLOW.label` is asked for on a flow with a `screen` node or an `approval` node, the two surfaces that show it. A flow with neither, such as a record-triggered or scheduled flow that only does work, still owes no label, because nothing shows it.
15+
- `flows.FLOW.approvals.NODE.label` is asked for on every `approval` node that has an `id`, seeded with the node's own `label`.
16+
- Both are reported as `i18n/missing-flow` by `os lint`, listed by `os i18n check`, and written into the skeleton by `os i18n extract`. `os i18n check --help` names approval steps among the surfaces it covers.
17+
18+
**What you may see.** An app that ships an approval flow and declares a locale beyond its default now gets an `i18n/missing-flow` finding for each untranslated approval flow and step. Under `os lint --i18n-strict` or `os i18n check --strict` these are errors, like every other missing translation. To clear them, translate the keys in that locale's pack, for example:
19+
20+
```ts
21+
flows: {
22+
expense_approval: {
23+
label: '报销审批',
24+
approvals: { manager_review: { label: '经理审核' } },
25+
},
26+
},
27+
```
28+
29+
`os i18n extract` writes the empty slots for you and keeps the strings a pack already translates. No key, schema or export changes: both keys were already part of the translation contract, and `os validate` already accepted them.

‎examples/app-showcase/src/system/translations/index.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,48 @@ export const ShowcaseTranslationBundle = {
11271127
},
11281128
},
11291129
},
1130+
// The approval flows: the flow's name and each approval step's name, as
1131+
// the approvals inbox, the record's approval panel and the request page
1132+
// show them in the reader's locale.
1133+
showcase_budget_approval: {
1134+
label: '项目预算审批',
1135+
approvals: { manager_review: { label: '经理审核' }, exec_review: { label: '高管审核' } },
1136+
},
1137+
showcase_closure_signoff: {
1138+
label: '结项签批(审批子流程)',
1139+
approvals: { ask_signoff: { label: '经理签批' } },
1140+
},
1141+
showcase_invoice_signoff: {
1142+
label: '发票双重签批(并行审批)',
1143+
approvals: { dual_signoff: { label: '财务 + 法务签批' } },
1144+
},
1145+
showcase_one_task_signoff: {
1146+
label: '单个任务签批(逐项子流程)',
1147+
approvals: { review: { label: '任务签批' } },
1148+
},
1149+
showcase_expense_signoff: {
1150+
label: '费用报告签批',
1151+
approvals: { dual_signoff: { label: '经理 + 财务签批' } },
1152+
},
1153+
showcase_committee_quorum: {
1154+
label: '大额费用 — 委员会多数签批',
1155+
approvals: { committee: { label: '委员会签批(三分之二)' } },
1156+
},
1157+
showcase_dynamic_approval: {
1158+
label: '公告动态审批',
1159+
approvals: { lead_review: { label: '负责人审核' }, co_sign: { label: '会签' } },
1160+
},
1161+
showcase_approver_bindings: {
1162+
label: '审批人绑定示例(#3508)',
1163+
approvals: {
1164+
by_user: { label: '指定用户' },
1165+
by_team: { label: '团队成员' },
1166+
by_department: { label: '部门成员' },
1167+
by_position: { label: '岗位任职者' },
1168+
by_manager: { label: '提交人的经理' },
1169+
by_field: { label: '触发字段中的用户' },
1170+
},
1171+
},
11301172
},
11311173
},
11321174
};

0 commit comments

Comments
 (0)