Repository navigation
Commit 7c164cf
i18n(plugin-approvals): ship the approval objects, notifications, record page and e-mail link line in zh-Hant, ar, fr and pt-BR (#30790)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D7v5H7BaFmL7sUCoN7tSxhm)_
domain:server#1 · os-elon-musk · session_016WV4cya5ej5GQV86RPbRPK
Part of #30512 — package 9 of 11, first half
(`@objectstack/plugin-approvals` in `zh-Hant`, `ar`, `fr`, `pt-BR`). The
card stays open: the second half (`ru`, `de`, `ko`), settings and
platform-objects follow, and the last PR of the series makes the bundle
check read the platform locale table.
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么:** 审批插件的 3 个对象(审批请求、审批动作、审批委派)的名称、字段、选项、帮助和动作,审批通知的 40
条句子,审批请求记录页的标题和「详情 / 时间线」两个标签,以及审批邮件里「打开审批」那一行,补上繁中、阿语、法语、巴葡 4
种。俄语、德语、韩语在下半包。
- **为什么改:** 平台语言表要求每个界面带齐 11 种语言;这是第 3 期按包补齐的第 9 个包的上半(每种语言 164 条对象文本 +
40 条消息)。用这 4 种语言的审批人和提交人看到的审批界面、通知和邮件不再是英文。
- **风险与回滚:** 只加翻译数据和注册行,不动逻辑、schema、接口;邮件模板的结构、选模板的规则和
`EMAIL_TEMPLATE_FLOOR_LOCALE` 都没动,只给「打开审批」那一行加了 4 种语言(按裁决 A)。原有 4
种语言一字未改。测试改动只是各语言测试把 4 种新语言加进列表(覆盖变宽,没有放宽任何断言)。回滚即撤 PR。
- **先看:** `src/translations/index.ts`(按表标签注册,zh-CN 在 zh-Hant
前,每种语言带页面标题和消息)、`src/approval-email-templates.ts` 的
`APPROVAL_EMAIL_LINK_LINES`、`src/translations/messages.ts`,再看
`sys-approval-request-page.test.ts`。
- **两分钟验证:** `node scripts/check-i18n-bundles.mjs --filter=approvals` 输出
`plugins/plugin-approvals in sync`;`pnpm --filter
@objectstack/plugin-approvals test` 全绿。
- **需要你做的:** 无,席位落地。
## What changes
- Four new locales under the platform locale table's tags (`zh-Hant`,
`ar`, `fr`, `pt-BR`): each a `TAG.objects.generated.ts` with all 164
object leaves of `sys_approval_request`, `sys_approval_action` and
`sys_approval_delegation`, plus its `TAG.source-hashes.generated.ts`,
written by the repo's own `os i18n extract --fill=default
--source-hashes` and served through `withSourceFallback` like the
existing three. `zh-CN` stays ahead of `zh-Hant` in `index.ts`.
- The hand-written records gain an entry per new locale: `messages.ts`
(the 40 approval notification sentences; `approvalMessages` widens to
eight locales), `pages.ts` (the record page label
`sys_approval_request_detail`, recorded against the same `en` digest the
existing three carry), and the record page's inline Details / Timeline
labels in `sys-approval-request.page.ts`.
- `approval-email-templates.ts`: `APPROVAL_EMAIL_LINK_LINES` (the line
that opens the request from its e-mail, `{{approvalUrl}}` kept
byte-identical) gains the four locales. This follows the seat's ruling
A, as recorded in the handover commit `7db48bdd`: the link line is added
per locale; the e-mail templates' shape, the template selection and
`EMAIL_TEMPLATE_FLOOR_LOCALE` are unchanged.
- The extract command in `scripts/i18n-extract.config.ts` lists the four
tags and its merge baseline imports the four bundles with their page
entries, so `check:i18n` covers them from this PR on.
## Tests
- `sys-approval-request-page.test.ts` pins the served locale set; it now
lists the eight locales this PR serves, and every served locale is still
held to carrying the authored page label.
- `approval-status-vocabulary.test.ts`,
`approve-decision-question.test.ts`, `decision-question-i18n.test.ts`,
`success-copy-names-request-i18n.test.ts` and
`admin-copy-vocabulary.test.ts` add the four new bundles to their locale
lists. Coverage widens; no assertion changed.
## Acceptance notes
- **Quality bar (#17508 / PR #19345):** every leaf written for the
reader; placeholders, code spans and identifiers byte-identical, checked
mechanically per leaf against `en` for the object bundles and for
`messages.ts` (key set, `{{holes}}`, `{holes}`, backtick spans, angle
tokens: all four locales OK, zero diffs). Arabic is RTL prose with
identifiers left in Latin script. `zh-Hant` was checked character by
character against OpenCC's Traditional (Taiwan) conversion: no
Simplified-only character remains (核准 keeps 准, the Taiwan usage).
- **Leaves equal to English, on purpose, each recorded by the extractor
as a source copy:** `fr` `Source`, `Note`, `Action`; `pt-BR` `Status`.
All are the native words. In `messages.ts`, `pt-BR`'s reason separator
`"; "` equals the English one.
- No cross-locale coincidence: `check:i18n-stale-fill` passes with the
baseline untouched.
- Carried unchanged from the released handover commit `7db48bdd`
(session `session_01Utp6Cai5CRdAs4u9gTipWU`): the patch id of this PR's
diff equals that commit's (`7e31c844`). The serial row "after #30208
lands" was cleared by the seat (6672288503): #30208's rows that touch
this package landed in PR #30551.
- The existing `ja-JP` / `es-ES` bundles still carry English source
copies on `sys_approval_delegation`; this PR does not touch the existing
three locales.
## Verification
<details><summary>Package suite, typecheck, build (verify
lock)</summary>
```
turbo run build --filter=!@objectstack/docs: 118/118 tasks successful, exit 0
pnpm --filter @objectstack/plugin-approvals test && typecheck (at head 63d63a1, on main 561d532)
Test Files 115 passed (115)
Tests 1492 passed (1492)
check:test-typecheck: OK (tsconfig.test.json)
os-verify-lock: VERDICT command-exit 0
same suite at 4a8b606d (the same patch on main adf6ee0): 115 files, 1492 passed, VERDICT command-exit 0
```
</details>
<details><summary>i18n gates and the derived families</summary>
```
node scripts/check-i18n-bundles.mjs --filter=approvals (at 63d63a1)
plugins/plugin-approvals in sync (15 bundle(s)) EXIT 0
node scripts/check-i18n-stale-fill.mjs (at 63d63a1)
check-i18n-stale-fill: OK (11 bundle set(s) — no new stale fills, 1 baselined). EXIT 0
dispatch-gates --commands (at 4a8b606d): 61 families, each run and recorded with its exit code: 61 x exit 0
dispatch-gates --ran: 61 derived, 61 run, 0 NOT-MEASURED (a derived zero)
re-derived at 63d63a1: the identical 61-command list
pnpm lint (repo-wide, at 4a8b606d): exit 0
eslint --no-inline-config on the changed .ts files: exit 0
changed lines 1962 (+1950 / -12), 21 files: under the 3000-line human-merge threshold
```
</details>
The branch is one commit on `main` `561d532c` (after #30767 landed). Its
diff has the same patch id (`7e31c844`) as `4a8b606d`, where the derived
families ran on main `adf6ee09`; none of the six main commits in between
touches `plugin-approvals`. The package suite and both i18n checks were
re-run on this head.
Dogfood: not run — content-only package PR, no `!` in the title and no
`(narrowing)` arm.
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cya5ej5GQV86RPbRPK)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 172eebb commit 7c164cf
21 files changed
Lines changed: 1950 additions & 12 deletions
File tree
- .changeset
- packages/plugins/plugin-approvals
- scripts
- src
- translations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
96 | | - | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
0 commit comments