Repository navigation
Commit ab159a9
i18n(service-realtime): ship the presence object in all eleven platform languages (#30536)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgBxjikPH2bUin9o95gbAxsx)_
domain:server#2 · os-bill · session_01Utp6Cai5CRdAs4u9gTipWU
Refs #30512 — package 1 of 11 (`@objectstack/service-realtime`). The
card stays open: the last PR of the series flips the bundle check to the
platform locale table.
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么:** 在线状态对象(`sys_presence`)的名称、字段、选项和帮助文字补上 7
种语言:繁体中文、阿拉伯语、法语、巴西葡萄牙语、俄语、德语、韩语,加上原有 4 种共 11 种,与平台语言表一致。
- **为什么改:** 平台语言表(#29428 裁决 F)要求每个界面都带齐 11 种语言;这是第 3 期按包补齐的第一个包,最小的一个(25
条)。
- **风险与回滚:** 只加翻译数据,不动代码逻辑、schema 或接口;原有 4 种语言文件一字未改。回滚即撤 PR。
- **先看:** `src/translations/index.ts`(新语言按表标签注册,zh-CN 排在 zh-Hant
前)、`scripts/i18n-extract.config.ts`(提取命令加 7 个标签),再抽看
`ar.objects.generated.ts`。
- **两分钟验证:** `node scripts/check-i18n-bundles.mjs --filter=realtime` 应输出
`in sync (21 bundle(s))` 并退出 0。
- **需要你做的:** 无,席位落地。
## What changes
- Seven new locales for `sys_presence`, registered under the platform
locale table's tags: `zh-Hant`, `ar`, `fr`, `pt-BR`, `ru`, `de`, `ko`.
Each is a `TAG.objects.generated.ts` with all 25 leaves and a
`TAG.source-hashes.generated.ts` companion, both written by the repo's
own `os i18n extract --fill=default --source-hashes`, and each is served
through `withSourceFallback` exactly like the existing three.
- The extract command in `scripts/i18n-extract.config.ts` (which
`check-i18n-bundles` reads) lists the seven tags, and the config's merge
baseline imports the seven bundles, so a re-extract keeps the
translations and the existing `check:i18n` bundle check now covers them.
- `index.ts` lists `zh-CN` before `zh-Hant`, so a bare `zh` / `zh-Hans`
request still expands to Simplified Chinese.
- Existing `zh-CN` / `ja-JP` / `es-ES` files are untouched (no rename,
no content change: the re-extract wrote them byte-identical).
- `bundle-ownership.test.ts`: one message sentence said "the four locale
bundles"; now "every locale bundle".
## Acceptance notes
- **Quality bar (#17508 / PR #19345):** every leaf is written for the
reader, placeholders and code spans byte-identical (checked
mechanically: same key set as `en`, same backtick spans and `{…}` tokens
per leaf). Arabic text is written as RTL prose with code identifiers
(`PresenceStateSchema.metadata`) left in Latin script.
- **Leaves equal to English, on purpose:** words that are the native
word in that language — `fr` `Session`, `Mobile`; `pt-BR` `Status`,
`Online`, `Offline`, `Desktop`, `Tablet`; `de` `Status`, `Online`,
`Offline`, `Desktop`, `Tablet`. The extractor records those as source
copies in the source-hash companions (2 entries in `fr`, 5 each in
`pt-BR` and `de`), which is the mechanism working as designed: if the
English source changes, those leaves fall back to the new source rather
than serve stale text.
- Not changed, noted: the existing `zh-CN` / `ja-JP` / `es-ES` bundles
still carry `display_title.label` / `.help` as English copies (two
source-hash entries each). Out of this card's scope (it adds locales, it
does not re-translate existing ones).
## Verification
<details><summary>Package suite, typecheck, build (verify
lock)</summary>
```
pnpm --filter @objectstack/service-realtime build && test && typecheck
Test Files 5 passed (5)
Tests 35 passed (35)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Bundle check covers the new locales (red when one leaf
is removed)</summary>
```
node scripts/check-i18n-bundles.mjs --filter=realtime
services/service-realtime in sync (21 bundle(s))
check-i18n-bundles: OK (1 package(s) — all bundles in sync, no undeclared authoring keys). EXIT 0
# one-off: delete `device.options.other` from ko.objects.generated.ts, re-run, restore from HEAD
services/service-realtime DRIFTED (2) EXIT 1
# restored: git diff HEAD empty
node scripts/check-i18n-stale-fill.mjs
check-i18n-stale-fill: OK (11 bundle set(s) — no new stale fills, 0 baselined). EXIT 0
```
</details>
<details><summary>Derived gate families at head 28ebd23 (dispatch-gates
--commands, reconciled with --ran)</summary>
```
dispatch-gates --ran: 62 derived famil(ies) accounted for — 61 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).
NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test — exit 3, prerequisite: this shallow clone cannot read the
self-test's pinned positive-control commit; CI runs it on a full checkout. Not read by anything this PR changes.
every other family exit 0, including pnpm check:i18n (all 10 bundle sets) and pnpm check:i18n-stale-fill
eslint --no-inline-config on the changed .ts files: exit 0 · check-nul-bytes: exit 0
changed lines 733 (+731 / -2), 18 files: under the 3000-line human-merge threshold
```
Full record: the seat's project folder,
`server-seat2/30512/gates-realtime-ran.txt`.
</details>
Dogfood: not run — content-only package PR, no `!` in the title and no
`(narrowing)` arm (dispatch order: package suite + `check:i18n` +
typecheck suffice).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6Cai5CRdAs4u9gTipWU)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent b4f4781 commit ab159a9
18 files changed
Lines changed: 731 additions & 2 deletions
File tree
- .changeset
- packages/services/service-realtime
- 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 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
67 | 81 | | |
68 | 82 | | |
69 | 83 | | |
| |||
| 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 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| 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 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 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 | + | |
| 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 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
22 | 36 | | |
23 | 37 | | |
24 | 38 | | |
| |||
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
57 | 78 | | |
0 commit comments