Skip to content

Commit ad3a211

Browse files
committed
fix(spec): changeset names core's warn text; objectql test comment follows the snake_case naming
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhKYT8L13Bgj8icT3i
1 parent f308adf commit ad3a211

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎.changeset/26128-translation-item-snake-case-name.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
'@objectstack/spec': patch
3+
'@objectstack/core': patch
34
---
45

56
fix(spec): `TranslationItemSchema.name` no longer tells authors to name a translation item after its locale tag
@@ -8,3 +9,5 @@ Clause-②: no
89
Metadata-protocol: none
910

1011
The `name` describe said a translation item was "conventionally the locale code (`zh-CN`)", but the metadata save door's item-name grammar refuses `zh-CN` (uppercase and a hyphen), so an author or agent following the describe got a 400 `INVALID_REQUEST` on the first save. The describe now says a translation item is named in snake_case like every metadata item (e.g. `zh_cn`), with the BCP-47 tag in `locale`. The save door and the runtime sync's read-side name fallback for rows stored before `locale` became required are unchanged; the sync's skip warning now points authors at `locale` only.
12+
13+
`@objectstack/core`: the authored-translation sync's no-locale skip warning now tells authors to set `locale` to the item's BCP-47 tag (e.g. `zh-CN`), instead of suggesting they name the item after it.

‎packages/objectql/src/protocol-publish-canonical-fold.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ async function refusalOf(fn: () => Promise<unknown>): Promise<{ code?: string; s
265265

266266
/**
267267
* A `translation` body. `TranslationItemSchema` requires `locale`; `name` is
268-
* declared and optional, and is deliberately NOT snake_case-constrained for
269-
* this type (translation items are conventionally named after their locale).
268+
* declared and optional; like every metadata item it is named in snake_case
269+
* (`zh_cn`), with the BCP-47 tag in `locale`.
270270
*/
271271
const translationBody = (label: string) => ({ locale: 'zh-CN', name: 'zh_cn', label });
272272

0 commit comments

Comments
 (0)