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 74496c6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-settings): translate the AI "Reset to environment defaults" button and cover action_button labels (#25527)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuACdPWFJTLDcTrByFCHLzqb)_Fixes#25502
Clause-②: no
Metadata-protocol: none
## What changed
Setup → AI's **Reset to environment defaults** button rendered in
English in zh-CN, ja-JP and es-ES sessions, next to its translated
siblings ("测试连接", "测试 Embedder").
- **The key:**
`packages/services/service-settings/src/manifests/ai.manifest.ts`
declares `{ type: 'action_button', id: 'reset', label: 'Reset to
environment defaults' }`. The console resolves an action label as
`settings.ai.actions.reset.label`. On base `dc3e5b9d7b`, none of the
four bundles had that key: `ai.actions` held only `test` and
`test_embedder`.
- **Translations added** in `translations/{zh-CN,ja-JP,es-ES}.ts`. The
wording follows each bundle's own word for the env source
(`sourceLabels.env`):
- zh-CN: `重置为环境变量默认值`
- ja-JP: `環境変数のデフォルトにリセット`
- es-ES: `Restablecer a los valores predeterminados del entorno`
- `en.ts` also gets the English entry beside `test` / `test_embedder`,
so the en fallback carries every AI action.
- **The coverage gap is closed for the whole class.** Before this
change, `settings-translation-coverage.test.ts` read titles, groups,
field keys and `info_banner` copy, but never `action_button` labels: a
button has an `id` and no `key`, so it matched none of the branches. The
test now covers action buttons in both directions:
- **Missing copy:** every shipped non-English locale must carry
`settings.NAMESPACE.actions.ID.label` for each `action_button` in every
manifest. A button with no `id` is reported, the same as a banner with
no `id`.
- **Dead copy:** no bundle, en included, may carry `actions` copy for a
button no manifest declares.
Landing: the claim's file surface (service-settings translation bundles
and the coverage test). The manifest is unchanged, and `packages/spec`
is not touched.
## Evidence
- **Ablation:** I removed only the zh-CN `reset` entry through
`scripts/ablation-replace.mjs`. The anchor hit once, x1 to x0, blob
`47f36fc78683` to `7bd43be08bbc`. The coverage test went red with `zh-CN
missing for ai: action:reset` (Tests 1 failed / 39 passed). The script
restored the file (blob equals HEAD `47f36fc78683`, `git diff HEAD`
empty). The test reads `src` through relative imports, so no dist
rebuild was involved.
- **Suite:** `pnpm --filter @objectstack/service-settings test` gave
Test Files 60 passed (60), Tests 1000 passed (1000). `pnpm --filter
@objectstack/service-settings typecheck` exited 0, and its tsconfig
includes all of `src`, test files included. Both ran on head
`591481a4d1`.
- **Gates:** `node scripts/pm/dispatch-gates.mjs --commands` derived 67
commands. 66 ran and exited 0. `pnpm check:dual-build-cjs-loads` exited
3 with PREREQUISITE NOT MET: it needs a full `pnpm build`, so it was not
measured locally and is left to CI. Reconciling with `--ran` accounted
for all 67 (66 run, 1 not measured).
## Acceptance notes
- With action buttons covered, no other action key is missing in a
non-English locale: mail, sms, storage, knowledge and ai are all green.
- `en.ts` has no `sms` namespace at all. en is not a gated locale, and
the English label falls back to the manifest literal. This is noted, not
changed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016g7nYP9wdNx1GDa5XDr7Uy
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix: Setup → AI's "Reset to environment defaults" button is now translated in zh-CN, ja-JP and es-ES
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The `ai` settings manifest declares an `action_button` with id `reset`, but no locale bundle carried `settings.ai.actions.reset.label`, so the button rendered in English beside its translated siblings. The bundles now carry it (en, zh-CN, ja-JP, es-ES).
11
+
12
+
The settings translation coverage test now reads every manifest's `action_button` labels: each shipped non-English locale must carry `settings.<namespace>.actions.<id>.label` for every action button, and no bundle may carry action copy for a button no manifest declares.
0 commit comments