Skip to content

Commit bc84ff2

Browse files
committed
skills(i18n): author the generated-bundle example through defineTranslationBundle (I18N-F-01 follow-up, I18N-G-05)
check:doc-authoring (#2035, ADR-0059) refused the block: it exported a bare `: TranslationBundle` literal, which is the one pattern that rule exists to keep out of the published catalog. The file's own canonical example already says to prefer the factory over a bare literal, so the block contradicted its own package — the inconsistency audit finding I18N-G-05 recorded from the other side (the flagship shipped example does the discouraged thing). The factory takes the wrapped values unchanged, so the shape the block teaches is the same one; only the authoring form is now the one the skill prescribes. Re-driven against the real exports before and after (throwaway driver in packages/services/service-storage typechecking the exact block against @objectstack/spec + @objectstack/platform-objects, tsc --noEmit exit 0, deleted in the same step with a clean tree). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
1 parent 2d550a2 commit bc84ff2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎skills/objectstack-i18n/SKILL.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,22 +412,23 @@ wrapped before it is a bundle at all.
412412

413413
```typescript
414414
// src/translations/index.ts
415-
import type { TranslationBundle, TranslationData } from '@objectstack/spec/system';
415+
import { defineTranslationBundle } from '@objectstack/spec';
416+
import type { TranslationData } from '@objectstack/spec/system';
416417
import { withSourceFallback } from '@objectstack/platform-objects/apps';
417418
import { enObjects } from './en.objects.generated.js';
418419
import { zhCNObjects } from './zh-CN.objects.generated.js';
419420
import { zhCNGeneratedSourceHashes } from './zh-CN.source-hashes.generated.js';
420421

421422
const enSource: TranslationData = { objects: enObjects };
422423

423-
export const StorageTranslations: TranslationBundle = {
424+
export const StorageTranslations = defineTranslationBundle({
424425
en: enSource,
425426
// 4th argument = the `--source-hashes` companion. Without it a leaf whose SOURCE has
426427
// moved goes on serving the superseded fill under a green `os i18n check` forever.
427428
// The 3rd stays undefined: it judges hand-authored `apps` / `dashboards` / `pages`,
428429
// which a fully generated set does not have.
429430
'zh-CN': withSourceFallback({ objects: zhCNObjects }, enSource, undefined, zhCNGeneratedSourceHashes),
430-
};
431+
});
431432
```
432433

433434
A plugin that owns its objects loads that bundle from its own `kernel:ready` hook rather

0 commit comments

Comments
 (0)