Skip to content

Commit 7f4042d

Browse files
fix(i18n): write 簽 not 籤 in generated zh-Hant (#366) (#370)
* fix(i18n): write 簽 not 籤 in generated zh-Hant (#366) OpenCC's twp preset maps Simplified 签 to 籤 (slip, tag) in 签核, 会签, and across word boundaries in 请求签名 and 中签发/上签发, where Taiwan writes 簽 (sign). gen-zh-hant.mjs now applies an ordered list of exact [wrong, right] pairs to the converter's output, with 標籤 and 書籤 set aside so no pair reaches into them. Fences still bypass both. The corpus is regenerated; every changed byte is 籤 -> 簽, and the 標籤 count is unchanged (45). Fixes #366 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRd8W1US76Cj78zAM8 * fix(i18n): type the private-use guard in gen-zh-hant as ASCII escapes (#366) The guard regex held raw U+E000 and U+F8FF, invisible in editors and review views and easy to drop silently. Same match, now \uE000-\uF8FF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRd8W1US76Cj78zAM8 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f44e307 commit 7f4042d

7 files changed

Lines changed: 63 additions & 16 deletions

File tree

‎apps/docs/scripts/gen-zh-hant.mjs‎

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,56 @@ const FIXED_PAIRS = ['apps/docs/lib/ui-text', 'apps/docs/app/[lang]/privacy', 'a
112112
* `www.objectos.ai` runs in production (`src/lib/zhconvert.ts`), and the
113113
* dependency is pinned to one exact version in `package.json` for the same
114114
* reason: the dictionaries decide the bytes, so a floating range would rewrite
115-
* the whole committed corpus on some future install.
115+
* the whole committed corpus on some future install. The one difference is the
116+
* `OVERRIDES` layer below, which `www.objectos.ai` does not have yet.
116117
*/
117-
const convert = OpenCC.Converter({ from: 'cn', to: 'twp' });
118+
const opencc = OpenCC.Converter({ from: 'cn', to: 'twp' });
119+
120+
/**
121+
* Corrections applied to the converter's output, in this order (#366).
122+
*
123+
* Simplified 签 is two Traditional characters: 簽 (sign, approve) and 籤 (slip,
124+
* tag). `twp` picks 籤 where a Taiwan reader expects 簽 in two ways. It lacks
125+
* the phrase (签核 → 籤核, 会签 → 會籤), and it segments across a word boundary:
126+
* 请求签名 is read as 请 + 求签 (draw a lot) + 名, and 中签发 as 中签 (win a
127+
* lottery) + 发. No upstream phrase fixes the second kind, because the wrong
128+
* word is a real word, so the fix is exact string pairs on the output.
129+
*
130+
* Every pair is applied to every converted run, so the output stays a function
131+
* of the Simplified text alone. Fences never reach this, as they never reach
132+
* the converter.
133+
*/
134+
const OVERRIDES = [
135+
['籤核', '簽核'], // 签核 sign off
136+
['會籤', '會簽'], // 会签 countersign
137+
['籤名', '簽名'], // 请求签名 request signature, not 求签 + 名
138+
['籤發', '簽發'], // 中签发 / 上签发 issue (a key), not 中签 + 发
139+
];
140+
141+
/**
142+
* Nouns where 籤 is right, set aside while the pairs run so that no pair can
143+
* reach into them: 标签名 (tag name) converts to 標籤名, which the 籤名 pair
144+
* would otherwise turn into 標簽名. They are swapped for private-use code
145+
* points and swapped back after.
146+
*/
147+
const KEEP = ['標籤', '書籤'];
148+
const KEEP_BASE = 0xe000;
149+
150+
function convert(text) {
151+
if (/[\uE000-\uF8FF]/.test(text)) {
152+
// A private-use character in the source would collide with the stand-ins.
153+
throw new Error('source contains a private-use code point (U+E000..U+F8FF)');
154+
}
155+
let out = opencc(text);
156+
KEEP.forEach((word, i) => {
157+
out = out.replaceAll(word, String.fromCharCode(KEEP_BASE + i));
158+
});
159+
for (const [wrong, right] of OVERRIDES) out = out.replaceAll(wrong, right);
160+
KEEP.forEach((word, i) => {
161+
out = out.replaceAll(String.fromCharCode(KEEP_BASE + i), word);
162+
});
163+
return out;
164+
}
118165

119166
/**
120167
* Pure ASCII on purpose: the converter never touches it, so it survives its own

‎content/docs/build/automation/approvals.zh-Hant.mdx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
# @generated zh-Hant from zh-Hans -- do not edit. Edit the English source, then regenerate: pnpm --filter @objectos/docs gen:zh-hant
33
title: 審批流程
4-
seoTitle: "審批流程:把記錄路由給人籤核"
5-
description: 把記錄路由給人籤核 —— 同時不讓自動化悄悄繞過行級安全。
4+
seoTitle: "審批流程:把記錄路由給人簽核"
5+
description: 把記錄路由給人簽核 —— 同時不讓自動化悄悄繞過行級安全。
66
editions: [community, cloud, enterprise]
77
translation:
88
source_sha: e03dd11f32910f971d7514f12aab8e3c2ac1eceb25966b2b4162185eb062a521
@@ -95,7 +95,7 @@ translation:
9595
> `approval-approver-type-deprecated`);如果 value 指的是組織崗位,修復方法
9696
> 是 `type: 'position'`。
9797
98-
### 法定人數和分組會籤(16.0) [#quorum-and-per-group-sign-off-160]
98+
### 法定人數和分組會簽(16.0) [#quorum-and-per-group-sign-off-160]
9999

100100
除了 `first_response` 和 `unanimous`,16.0 新增了兩種聚合模式。
101101
**法定人數(quorum)**在獲得 N 中 M 個批准時定案:
@@ -113,7 +113,7 @@ config: {
113113
}
114114
```
115115

116-
**分組(per_group)**要求*每個*帶標籤的分組都籤核(會籤)—— 用 `group`
116+
**分組(per_group)**要求*每個*帶標籤的分組都簽核(會簽)—— 用 `group`
117117
給審批人打標籤,只有當每個分組都獲得 `minApprovals` 個批准(預設每組 1 個)
118118
時,節點才會前進:
119119

@@ -164,7 +164,7 @@ config: {
164164
`'department'` / `'position'` / `'team'`),它說明表示式返回的是哪種 id,
165165
並通過靜態審批人型別所用的同樣的圖查詢展開每一個 id。在
166166
`behavior: 'per_group'` 下,每個返回值構成自己的分組 —— 每個返回的部門
167-
各需一次籤核。
167+
各需一次簽核。
168168

169169
`record` 和裸欄位名被有意設為**不可用**:在平臺的其他所有介面上,`record`
170170
的含義都是"事件發生時的記錄",在這裡複用它會悄悄地把兩個時間點之一混淆

‎content/docs/build/automation/index.zh-Hant.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @generated zh-Hant from zh-Hans -- do not edit. Edit the English source, then regenerate: pnpm --filter @objectos/docs gen:zh-hant
33
title: 自動化
44
seoTitle: "自動化:流程、工作流和審批"
5-
description: 為工作選對工具 —— 流程管步驟,工作流管狀態,審批管人工籤核。
5+
description: 為工作選對工具 —— 流程管步驟,工作流管狀態,審批管人工簽核。
66
editions: [community, cloud, enterprise]
77
translation:
88
source_sha: e39ead174c229520946d302d63cc2c7e6903c12d87048df02a15aed0b5ab0a84
@@ -18,7 +18,7 @@ translation:
1818
|---|---|---|
1919
| "當 X 發生時,做 Y" —— 在記錄變更、定時計劃或按鈕點選時執行的步驟 | **流程** | [流程](/docs/build/automation/flows) |
2020
| "這條記錄只能在這些狀態之間流轉" —— 受控的生命週期 | **工作流**(狀態機) | [工作流](/docs/build/automation/workflows) |
21-
| "必須有人籤核才能繼續" —— 被路由的人工決策 | **審批** | [審批](/docs/build/automation/approvals) |
21+
| "必須有人簽核才能繼續" —— 被路由的人工決策 | **審批** | [審批](/docs/build/automation/approvals) |
2222

2323
經驗法則:用工作流建模**狀態**,用流程建模**步驟**。審批不是一個單獨的引擎 —— 審批就是一個在審批節點處暫停、直到有人做出決定的流程。
2424

@@ -30,7 +30,7 @@ translation:
3030
- **流程**執行這些遷移前後的副作用:傳送郵件、更新記錄、呼叫外部服務、等待、分支。
3131
- 流程中的**審批節點**會阻塞執行,直到審批人採取行動,然後沿著批准或拒絕分支繼續。
3232

33-
所以"一個案例按 new → assigned → resolved 流轉"是工作流;"升級時通知經理"是流程;"超過 5 萬美元的折扣需要財務經理籤核"是帶審批節點的流程。
33+
所以"一個案例按 new → assigned → resolved 流轉"是工作流;"升級時通知經理"是流程;"超過 5 萬美元的折扣需要財務經理簽核"是帶審批節點的流程。
3434

3535
> **提示:** 如果一個需求讀起來是"當 X 發生時,做 Y",那它是流程。如果讀起來是"這條記錄絕不能跳過某個狀態",那它是工作流。從這裡出發,你很少會選錯。
3636

‎content/docs/build/automation/workflows.zh-Hant.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const dealClosedWon = defineFlow({
200200
| 頁面 | 為什麼 |
201201
|---|---|
202202
| [流程](/docs/build/automation/flows) | 遷移前後的副作用 —— 觸發器、步驟、錯誤處理 |
203-
| [審批](/docs/build/automation/approvals) | 作為流程內暫停的人工籤核 |
203+
| [審批](/docs/build/automation/approvals) | 作為流程內暫停的人工簽核 |
204204
| [驗證規則](/docs/build/data/validation-rules) | 狀態機所屬的規則家族 |
205205
| [CEL 表示式](/docs/reference/cel) | `requiredWhen`、驗證規則和流程條件背後的語言 |
206206
| [資料建模](/docs/build/data) | 你正在約束其生命週期的物件 |

‎content/docs/configure/mcp.zh-Hant.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ claude mcp add --transport http my-app https://your-deployment.example.com/api/v
5858

5959
## 無頭場景:API Key [#headless-api-keys]
6060

61-
在 **Setup → Connect an Agent**(接入 Agent,那裡還提供各客戶端可直接複製貼上的接入片段)中籤發 Key,或通過 REST:
61+
在 **Setup → Connect an Agent**(接入 Agent,那裡還提供各客戶端可直接複製貼上的接入片段)中簽發 Key,或通過 REST:
6262

6363
```bash
6464
curl -b cookies.txt -X POST https://your-deployment.example.com/api/v1/keys
@@ -83,7 +83,7 @@ curl -b cookies.txt -X POST https://your-deployment.example.com/api/v1/keys
8383

8484
- **`OS_MCP_STDIO_ENABLED=true`** 開啟 stdio 自動啟動(預設**關閉**)。`OS_MCP_SERVER_ENABLED` 現在只管 HTTP 入口——`OS_MCP_SERVER_ENABLED=true` 同時拉起 stdio 的舊行為還會保留一個版本,並伴隨棄用警告。
8585
- stdio **必須配置 `OS_MCP_STDIO_API_KEY=osk_...`**。該 Key 通過與 HTTP、REST 完全相同的驗證 + 授權鏈解析,因此物件許可權、記錄訪問、欄位級安全和租戶隔離對 stdio 呼叫的作用與 `/api/v1/mcp` 完全一致——並且每次讀取都會重新解析 Key,吊銷立即生效。
86-
- 該傳輸是 **fail-closed** 的:開啟自動啟動卻沒有可解析的 Key,啟動會直接被拒絕;刻意不提供任何無身份回退,也沒有 `system` 旁路。若需要完整許可權,請在平臺管理員或專用服務身份上籤發 Key。
86+
- 該傳輸是 **fail-closed** 的:開啟自動啟動卻沒有可解析的 Key,啟動會直接被拒絕;刻意不提供任何無身份回退,也沒有 `system` 旁路。若需要完整許可權,請在平臺管理員或專用服務身份上簽發 Key。
8787

8888
## Agent 能得到什麼 [#what-the-agent-gets]
8989

‎content/docs/configure/webhooks.zh-Hant.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ X-Objectstack-Delivery: <delivery id — use as your idempotency key>
4040
X-Objectstack-Attempt: <attempt number, starting at 1>
4141
```
4242

43-
當 webhook 訂閱設定了 `secret` 時,ObjectOS 還會為每個請求籤名:
43+
當 webhook 訂閱設定了 `secret` 時,ObjectOS 還會為每個請求簽名:
4444

4545
```text
4646
X-Objectstack-Signature: sha256=<hex hmac>

‎content/docs/use/approvals.zh-Hant.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# @generated zh-Hant from zh-Hans -- do not edit. Edit the English source, then regenerate: pnpm --filter @objectos/docs gen:zh-hant
33
title: 審批
44
seoTitle: "審批收件箱:提交、審閱和跟蹤請求"
5-
description: 提交記錄等待籤核、處理指派給你的請求,並隨時掌握每個審批的進展。
5+
description: 提交記錄等待簽核、處理指派給你的請求,並隨時掌握每個審批的進展。
66
editions: [community, cloud, enterprise]
77
translation:
88
source_sha: 2e66606b534686f5a7d8944dc432440b441ef36a02de56101bfa89b2627a1ce3
99
guide_rev: 1
1010
mode: auto
1111
---
1212

13-
有些記錄在往前推進之前需要一次籤核 —— 超額的報銷、一個折扣、一張請假單。此時 ObjectOS 會建立一條**審批請求**:一條由系統管理的即時記錄,從提交那一刻起追蹤這次送審,直到有人批准或拒絕。這些追蹤記錄你永遠不需要自己建立或編輯 —— 系統會隨著決定的做出自動保持它們最新。
13+
有些記錄在往前推進之前需要一次簽核 —— 超額的報銷、一個折扣、一張請假單。此時 ObjectOS 會建立一條**審批請求**:一條由系統管理的即時記錄,從提交那一刻起追蹤這次送審,直到有人批准或拒絕。這些追蹤記錄你永遠不需要自己建立或編輯 —— 系統會隨著決定的做出自動保持它們最新。
1414

1515
本頁覆蓋流程的兩端:把東西提交審批,以及處理等你決定的請求。
1616

0 commit comments

Comments
 (0)