Repository navigation
Commit 7878cf0
fix(service-storage): translate the storage_attachment_member permission set (#35796)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoA1ALjVcUcAuAA15MyUocBx)_
Fixes #33986
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 中文控制台的管理员在「设置 → 权限集分配」里看到的附件成员权限集,名称和说明从英文变成中文,另外九种界面语言同样有了译文。
- 替使用非英文界面的管理员解决:存储服务带来的这个附件权限集漏了翻译,是列表里唯一一行英文。
- 出错时最多是某种语言的措辞不够贴切,权限本身和发放时机都不变,可以直接撤回。
- 无
## What changes
-
`packages/services/service-storage/src/translations/permission-sets.ts`
(new, hand-authored): the `permissions.storage_attachment_member.label`
/ `.description` translations for the ten locales the sibling built-in
sets ship (zh-CN, ja-JP, es-ES, zh-Hant, ar, fr, pt-BR, ru, de, ko).
zh-CN label: 附件:读取与添加(所有成员).
- `packages/services/service-storage/src/translations/index.ts`: each
translated locale of `StorageTranslations` now carries that
`permissions` group beside its generated `objects`, the same shape
plugin-security's `SecurityTranslations` uses. No generated file is
touched.
- Changeset: `@objectstack/service-storage` patch.
## Why
The set is declared by service-storage (`attachment-member-grant.ts`)
and contributed to the member baseline at runtime, so plugin-security's
permission-set bundle never carried it: that bundle's own pin
(`permission-set-descriptions.test.ts`, "translates exactly the built-in
sets") limits it to the nine sets plugin-security declares. The owner of
the set is the owner of its translation (ADR-0029 D8). Both bundles
reach the i18n service through `loadTranslations`, which deep-merges, so
the two `permissions` groups sit side by side and
`translatePermissionSet` resolves either set on `GET /meta/permission`.
## Tests
- New `src/translations/permission-sets.test.ts` (24 tests): per
translated locale, the group holds exactly `storage_attachment_member`,
label and description differ from the English, the label keeps the
English label's shape, and `translateMetadataDocument('permission', …)`
serves the translated label and description; `en` serves the set as
declared (same reference); CONTROL: a stand-in sibling `member_default`
group and this bundle loaded into `createMemoryI18n` in both orders, and
both sets still resolve in zh-CN.
- Ablation (one-off, not committed): deleting the `permissions:` line
from `withSets` in `index.ts` through `scripts/ablation-replace.mjs`
(anchor 1 -> 0, blob ab15c3d -> 6f1df31f0bcd) turns the file red,
`Tests 12 failed | 12 passed (24)` (the ten per-locale group checks and
both merge controls); restored, blob == HEAD, `git diff HEAD` empty.
## Acceptance notes
- The label follows the English label's shape (`Attachments: read and
attach (every member)`, a colon and no ` — `), the rule
plugin-security's pin holds its own labels to, rather than the siblings'
` — ` split; the English source label is unchanged (this card changes
translations only).
- The English description is two sentences and names the object; the
translations follow the source. The siblings' one-sentence description
pin covers plugin-security's own sets only.
- Untouched and binding: what the set grants and when it is contributed
(maintainer ruling 6879388034, the ⛔ on
`contributeAttachmentMemberGrant`).
- `check:i18n-coverage` lints static stack configs and cannot see this
runtime-contributed set; its count is unchanged.
## Verification
Two-minute check: `pnpm --filter @objectstack/service-storage exec
vitest run --maxWorkers=2 src/translations/permission-sets.test.ts`
prints `Tests 24 passed (24)`.
<details><summary>Local runs</summary>
- `pnpm --filter '@objectstack/service-storage^...' build`: lock VERDICT
command-exit 0.
- `pnpm --filter @objectstack/service-storage test` + `typecheck`: `Test
Files 87 passed (87)`, `Tests 1697 passed | 1 skipped (1698)`,
`check:test-typecheck: OK`; VERDICT command-exit 0 (head 50a8e08).
- Final head f6ce5b4: focused `permission-sets` + `bundle-ownership`
+ `attachment-member-grant` tests `Tests 36 passed (36)`, `typecheck`,
`check:nul-bytes`, `check:i18n-stale-fill`: VERDICT command-exit 0.
- `dispatch-gates --ran`: 63 of 65 derived families run, exit 0 each.
NOT MEASURED locally: `check:i18n` and `check:dual-build-cjs-loads`,
reason: both need the whole workspace build (exit 3, prerequisite not
met); declared to CI.
- `overlap-check --branch=HEAD`: VERDICT clean exit 0.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (CI-owned run).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: not touched.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibyy9KSA69EGZtjDj9c
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1a21ce9 commit 7878cf0
4 files changed
Lines changed: 143 additions & 10 deletions
File tree
- .changeset
- packages/services/service-storage/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 | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments