You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4985dde
Browse filesBrowse the repository at this point in the historyBrowse files
feat(i18n, app-shell): one word per state in Studio and Setup, and the permission matrix columns in Chinese (#29841)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbMPuCd86KE2QReyiA2Xfs9j)_Fixes#29729
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:Studio 和 Setup 里同一个状态只用一个词。中文里“打开/关闭”统一为 启用/停用,“定制”这个动作统一为
定制(不再混用 自定义),环境里新建、非软件包带来的权限集标为 新增;权限矩阵的列头在中文下直接写 创建、读取……查看全部、修改全部,不再是
C/R/U/D 字母;“OWD”前缀改为 记录共享模型。英文里流程状态统一为 Switched on / Switched off。
- **为什么改**:同一件事在相邻两个界面叫不同的名字,用户会以为是两件不同的事;中文用户看不懂 C/R/U/D 和 OWD
这些英文缩写。另外修了一个缺陷:中文界面下 Setup 的权限矩阵如果在中文词表加载完成前就渲染,图例和列头提示会一直显示英文。
- **风险与回滚**:几乎只改文案和一处 React memo 的依赖,没有数据、接口或权限行为的变化。回滚就是还原这个 PR。英文有 7 条
Studio 自动化状态文案改了词,已按设计豁免登记在 en 漂移门禁的基线里。
- **先看**:`ui/packages/i18n/src/namespaces/studio/zh.ts` 的改动行,以及
`PermissionMatrixEditor.tsx` 里列头、图例和 OWD 标签的几处改动。
- **两分钟验证**:用中文打开 Setup 的某个权限集和 Studio
的“访问”页,看列头是中文词、没有字母图例、对象行的标签是“记录共享模型:私有(默认)”;打开 Studio
的自动化页,看软件包流程的开关写“本部署中已启用/已停用”。截图见下方“Screenshots”。
- **需要你做的**:确认 新增 / Added 这个权限集徽标用词(理由见下方 Acceptance notes),以及 #29809
合入后是否需要跟进。
## What changes
Strings, one legend gate, one chip and one memo. No data, API,
permission or protocol behaviour changes.
1. **Switched on / switched off, one word.**
- zh: the packaged-flow ledger family
(`engine.studio.ledger.on/off/notRunning/hint/walled/switchedOn/switchedOff`)
moves from 开启 / 关闭 to 启用 / 停用. Console `packagedAutomation.off` moves
from 已关闭 to 已停用, and `actionsSubtitle` from 关闭后 to 停用后.
- en: `engine.studio.ledger.on/off/notRunning` read "Switched on/off for
this deployment[, not running here]".
`engine.studio.auto.on/off/offTitle/enabled/disabled/enabledToast/disabledToast`
read "Switched on" / "Switched off" (they said On / Off and Enabled /
Disabled). These are the words #29705 landed for the landing. The verbs
(`enableTitle` / `disableTitle`) stay verbs.
2. **The Customize act reads 定制** (zh), in 12 rows: the button, its
titles, the walled and no-version lines, the draft footer, the restore
confirmations, the landing lines quoting the button, and the two
form-editor notes. This matches 已定制 and 可定制. Nine rows where 自定义 means
user-defined (a custom value, key, renderer, page or code) keep 自定义. The
census in the stateVocabulary test lists both groups.
3. **`perm.badge.custom` reads 新增 / "Added"** (it read 自定义 / "Custom").
See Acceptance notes for why it is not 已定制.
4. **Permission matrix columns.**
- zh: the object-action headers spell the words through a new
`perm.col.*` family: 创建 读取 编辑 删除 导出 转移 查看全部 修改全部. The two long ones
break between 查看/全部 and 修改/全部 (`break-keep`).
- en: keeps C R U D E Tr VA MA.
- The legend line that spells the letters out is drawn only where the
headers are abbreviations (`headersAbbreviate`). So zh no longer repeats
the words, and en keeps the legend.
5. **Setup's per-object chip** reads through `perm.owd.chip`: en "OWD
{value}", zh 记录共享模型:{value}. Before, it was a hard-coded `OWD ` prefix.
6. **Fixed: lazy-catalogue memo.** `getObjectActions(locale)` was
memoised on the locale alone. A zh matrix whose first render ran before
the lazily fetched `studio` catalogue was resident kept the en answer,
so Setup's legend and every header tooltip read English in zh-CN. The
deps now carry `isStudioCatalogueLoaded(locale)`.
7. **`check-i18n-en-drift` accepts `objectstack#N`.** `ISSUE_PATTERN` is
now `^(?:objectui|objectstack)#\d+$`, because the ui tree lives in this
repo now. The 7 en `auto.*` rows above are designer waivers keyed to
`objectstack#29729`, and the test's designer ceiling moves 0 → 7.
## Acceptance notes
- **Why the badge says 新增 / Added, not 已定制.**
`PermissionMatrixEditor.tsx` L748 picks the badge with `const
shippedByPackage = !!packageId || codeIsArtifact;`. The
`perm.badge.custom` branch is therefore a permission set that no package
ships and that has no code artifact: one this deployment added. Nothing
on that branch checks whether a shipped base was changed, so 已定制
(customized) would claim something the editor does not know. 新增 / Added
is the word `engine.customizationMark.added` already uses for an item
added beside a base, and the census test pins the two to the same word.
- **#29809 (open, seat 4)** changes which branch a set added by a
`.custom` pair takes. This PR does not touch that choice: only the word
on the `custom` branch changes. If #29809 lands first, the rationale
above still holds for whatever reaches that branch.
- **Not changed here:**
- The en Console `packagedAutomation` On / Off: not ruled on this card.
- From main, new since the card was written: the zh Console profile app
lock (已开启 / 已关闭, a different surface), and
`engine.packages.detail.*Disableable` (禁用并重新启用, a new 禁用 / 停用 split).
These are left for a follow-up card.
## Screenshots
On the merged tree, in `/mnt/project-files/issue-29729/after/` (project
files):
- `after-environment-{zh,en}-1304.png`: Setup's matrix, zh words with no
legend, en letters with the legend, and the chip.
- `after-studio-{zh,en}-1304.png`: the Studio Access pillar.
- `rail-{en,zh}-1024.png`: the automation rail at the narrowest Studio
width. "Switched on" is 69 px in a 215 px legend with no overflow
(scrollWidth equals width). The en legend grows from 3 lines to 4 (72 px
high). zh is unchanged at 53 px.
Before shots and the legend options are in
`/mnt/project-files/issue-29729/legend/`.
## Tests
- New `PermissionMatrixEditor.columnHeaders-29729.test.tsx`. It does not
preload the catalogue and asserts the not-resident precondition first.
It checks zh headers, tooltips and no legend in both renderings; an en
CONTROL with letters and the legend; and the chip in zh and en.
- `DirectoryPage.stateVocabulary-29705.test.tsx`: a second-pass census.
- No 开启 / 关闭 in the switched-on/off rows.
- No bare On / Off / Enabled / Disabled in the en rows.
- The packaged actions in zh, with an en CONTROL.
- The 12 Customize rows read 定制 and agree with the button and landing.
- A 7-row 自定义 CONTROL.
- The badge equals the customization mark's `added` word.
- `check-i18n-en-drift.test.ts`: accepts `objectstack#N`. A CONTROL
still refuses `objectstack 29729`, `objectstack#`, `cloud#12`, `#29729`,
`objectstack#29729x` and `objectui-3650`. The ceiling ratchet moves to
7.
- These tests are updated to the new words: the badge,
provenanceBadge-7611, ledgerSwitch-28148, FlowStatusDot and
customizeFlow-28570. customizeFlow now checks the header by its disable
title, because "Switched on" also appears in the Status pill.
<details><summary>Verification</summary>
- Nine ablations each turned red, with the tree restored after each:
- the memo deps;
- the Setup legend gate;
- zh `perm.col.create` back to C;
- the `OWD ` prefix back;
- zh ledger.off back to 已关闭;
- zh customize.action back to 自定义;
- zh badge back to 自定义;
- zh `packagedAutomation.off` back to 已关闭;
- en `auto.off` back to Off.
The gate script is pinned by its CONTROL test, not by ablation.
- 184 neighbour test files are green, in three chunks. After the main
merge, the 13 touched test files (220 tests) are green.
- `dispatch-gates`: all 35 derived gates exit 0. `check-i18n-en-drift`
(run by hand, not derived) is green with 7 waived.
- Type-check passes for `@object-ui/i18n` and `@object-ui/app-shell`.
ESLint: 0 errors.
- These gates exit 0 after the merge: sdui-manifest, changeset-no-major,
empty-changeset, adr-0087, nul-bytes, type-check-debt.
- Deviation: the refusal text and the help-text examples in
`check-i18n-en-drift.mjs` now spell `objectstack#1234`, beyond the
one-line pattern change.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jR2PhzeUkFuXHiwpdp)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
feat(i18n, app-shell): Studio and Setup give a switched-on, switched-off or customized item one word, and the permission matrix reads its columns in Chinese
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
- Switched on and switched off read 启用 / 停用 in zh-CN wherever Studio and Setup name the state: the packaged-flow ledger switch said 开启 / 关闭, and Setup's packaged actions said 已关闭 in the column and 开启 / 关闭 in the switch-off confirm and its toasts. In en, Studio's flow run status says "Switched on" / "Switched off" (it said On / Off and Enabled / Disabled), the word the landing and the ledger switch use; the ledger switch reads "Switched on/off for this deployment".
12
+
- The Customize act reads 定制 in zh-CN (the button, its titles, the restore confirmations, the landing lines quoting the button, the form-editor notes), matching 已定制 and 可定制. 自定义 stays where it means user-defined (a custom value, key, renderer, page or code).
13
+
- A permission set no package ships reads 新增 / "Added" (it read 自定义 / "Custom"): it is an item this deployment added, not a customized one.
14
+
- The permission matrix's object columns read the action words in zh-CN (创建 … 查看全部, 修改全部) through new `perm.col.*` rows; en keeps C … MA and the legend line that spells them out, which zh no longer needs. Setup's per-object chip reads through `perm.owd.chip` (zh 记录共享模型:私有), not a hard-coded `OWD ` prefix.
15
+
- Fixed: in zh-CN, Setup's matrix legend and every column tooltip read English when the matrix rendered before the Chinese Studio strings had loaded. The columns are rebuilt once they land.
0 commit comments