Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/36873-i18n-skill-locales-source-locale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/skills': patch
---

docs(skills): the i18n skill says what `GET /api/v1/i18n/locales` answers about the default and source locale

Clause-②: no (published prose only; names a member the locales read already returns on main)
Metadata-protocol: none

The Registration section of `skills/objectstack-i18n/SKILL.md` now says the locales answer marks the default locale (`isDefault`) and names `sourceLocale` (the declared one, else the default), so a client that writes translations can tell which language inline `label:` text is in without reading the stack config. The words are paid for in the same file, with no fact removed: the note that the contract's `.ts` source does not ship becomes one line, and the optional-methods sentence drops "Treat them as".
12 changes: 6 additions & 6 deletions skills/objectstack-i18n/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ resolves keys with fallback:
import type { II18nService } from '@objectstack/spec/contracts';
```

(The contract's source `.ts` is not part of the published package — only
`src/**/*.zod.ts` ships — so there is no `node_modules` source to read.)
(Only `src/**/*.zod.ts` ships, so the contract's `.ts` source is not in `node_modules` to read.)

Methods implemented by both shipped adapters (`FileI18nAdapter` from
`@objectstack/service-i18n`, and the in-memory fallback `@objectstack/core`
Expand All @@ -372,17 +371,18 @@ The in-memory fallback additionally resolves locale codes through `resolveLocale
case-insensitive → same platform-table language (`zh-TW` → `zh-Hant`) → base language
`zh-CN` → `zh` → first registered variant `zh` → `zh-CN`.

The contract also declares optional methods — `getFieldLabels`, `getCoverage`,
`suggestTranslations` — that **no shipped implementation provides**. Treat them
as extension points for a custom workbench or TMS adapter. (`getAppBundle` /
The contract declares optional methods — `getFieldLabels`, `getCoverage`,
`suggestTranslations` — that **no shipped implementation provides**: extension
points for a custom workbench or TMS adapter. (`getAppBundle` /
`loadAppBundle` went with the `o.*` shape they returned.)

### Registration

You do not wire this plugin: `os serve` registers `I18nServicePlugin` itself whenever the
stack config carries `translations` or `i18n` (kernel bootstrap is
**objectstack-platform → Runtime Boot Sequence**). It self-registers
`GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`.
`GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`; the locales
answer marks the default locale (`isDefault`) and names `sourceLocale` (the declared one, else the default).

---

Expand Down
Loading