Repository navigation
Commit a34c27c
fix(platform-objects): translate sys_user.role help text away from the retired Set Platform Role action (#19914)
Fixes #19897
Clause-②: no
## What changed
The `zh-CN`, `ja-JP` and `es-ES` help text for
`objects.sys_user.fields.role.help`
(`packages/platform-objects/src/apps/translations/{zh-CN,ja-JP,es-ES}.objects.generated.ts`)
still told a Setup administrator to press the "Set Platform Role" action
retired in #9968. The `en` text had already moved on twice (#17102, then
#19892/#19875) to name `OS_PLATFORM_OWNER_EMAIL` and the
`single`-posture `admin_full_access` grant, but the three translations
were never brought forward, and no i18n gate could see the drift because
the leaf carries no source-hash entry.
Retranslated the leaf in all three locales as a faithful rendering of
the CURRENT `en` text (per dispatch Zone 1), keeping code spans
verbatim: `OS_PLATFORM_OWNER_EMAIL`, `single`, `admin_full_access`,
`sys_user_permission_set`.
A repo-wide grep for the retired action's name/label across every
locale's `objects`/`metadata-forms` bundles (en included) now returns 0
hits — nothing else still references it.
## The source-hash half of the suggested fix — measured, not done, and
why
The issue's suggested shape (also in Zone 2 A2) is to also give the leaf
a source-hash entry so a future `en` change is caught. Traced and
measured, and it does not hold for a leaf that carries a genuine
translation:
- `collectFilledFromHashes`
(`packages/platform-objects/src/apps/translations/source-hash.ts`) — the
function `os i18n extract --source-hashes` calls to populate
`<locale>.source-hashes.generated.ts` — records a hash for a leaf
**only** when `value === currentSource` (it's still a literal,
untranslated copy of `en`) or `previous[path] === hash(value)` (it was
already such a copy on a prior run). A leaf holding a real translation
satisfies neither, by the mechanism's own documented design (ruling
#12069 Option A): "a leaf someone actually TRANSLATED … gets no record
and stays legacy-trusted."
- Ran `pnpm i18n:extract` after writing the three translations: it
rewrote nothing else (`git status` showed only the 3 hand-edited lines —
A3 satisfied), and it did **not** add a hash entry for this leaf,
exactly as the trace predicts.
- A2's own ablation, run for real: mutated the `sys_user.role` field's
`description` in `sys-user.object.ts`, regenerated `en` via `pnpm
i18n:extract`, and ran `pnpm check:i18n` and `pnpm
check:i18n-stale-fill`. **Both report nothing** for this leaf — 0
findings, 0 stale fills — both before and after this fix. Mutation and
regeneration were fully reverted (`git checkout HEAD --`, blob hashes
re-verified equal to `HEAD`).
So the leaf remains legacy-trusted going forward — not a regression this
PR introduces, but the pre-existing, ruled status quo for every
hand-translated leaf in the `objects` bundle (measured: 1203 in zh-CN,
1182 in ja-JP, 1173 in es-ES carry no hash and are not byte-copies of
`en`). Extending protection to genuinely-translated generated leaves
would need a new ruling in the shape of #8765/#12069, which is out of
this card's scope — full measurement and a recommendation are in the dev
report.
## Tests
- `pnpm --filter @objectstack/platform-objects build` — clean.
- `pnpm --filter @objectstack/platform-objects test` — 883/883 passed.
- `pnpm --filter @objectstack/platform-objects typecheck` — clean
(pre-existing shrink-only test-typecheck-debt entry untouched).
- `pnpm check:i18n` — OK (9/9 packages in sync).
- `pnpm check:i18n-stale-fill` — OK (0 stale fills, 0 baselined).
- Full derived gate list (`node scripts/pm/dispatch-gates.mjs
--commands`, re-derived on the final commit, `origin/main` fetched
first): 54 families, 53 ran clean, 1 (`pnpm check:dual-build-cjs-loads`)
NOT MEASURED — exits 3 PREREQUISITE NOT MET, needs a full
whole-workspace `pnpm build` unrelated to this diff's closure; CI's
`Build Core` covers it. `node scripts/check-issue-citations.mjs` (the
live command, since the derivation only reaches its `--self-test`) run
by hand: exit 0.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01TEhopqrWQYBycZzyJHpAZr)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8490127 commit a34c27c
4 files changed
Lines changed: 10 additions & 3 deletions
File tree
- .changeset
- packages/platform-objects/src/apps/translations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
0 commit comments