{"id":"@lssm-tech/lib.translation-runtime","slug":"lib.translation-runtime","name":"@lssm-tech/lib.translation-runtime","version":"3.0.4","path":"packages/platform/ui/translation-runtime","manifestPath":"packages/platform/ui/translation-runtime/package.json","manifestBlobSha":"808278a71b3f183c1a6a7048e634510990e90da5","layer":"platform","physicalArea":"ui","primaryArea":"ui-and-presentations","classification":{"privateDeclared":null,"catalogFamily":"runtime","catalogKind":"library","catalogStatus":"active","adoptionMode":"adoptable","stability":"stable"},"description":"Framework-independent ContractSpec translation runtime","descriptionOrigin":"package.json","catalog":{"family":"runtime","kind":"library","status":"active","adoptionMode":"adoptable","stability":"stable","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./diagnostics","./direction","./fallback","./formatter","./formatters/intl-messageformat","./i18next","./loader","./locale","./overrides","./precompile","./preferences","./snapshot","./contracts/catalog"],"documentation":[{"title":"Lib Translation Runtime documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.translation-runtime","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.lib.translation.runtime","title":"Lib Translation Runtime","description":"Framework-independent ContractSpec translation runtime","status":"active","useCases":["Adopt framework-independent contractspec translation runtime"],"aliases":["contractspec","i18n","translations","messageformat","icu","lib","translation","runtime"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/lib.translation-runtime","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/diagnostics","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/direction","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/fallback","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/formatter","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/formatters/intl-messageformat","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/i18next","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/loader","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/locale","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/overrides","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/precompile","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/preferences","symbols":[]},{"from":"@lssm-tech/lib.translation-runtime/contracts/catalog","symbols":["Locale","MessageKey","TranslationEntry","TranslationCatalogMeta","PlatformTranslationCatalog","BlueprintTranslationCatalog"]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/lib.translation-runtime package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/diagnostics","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/direction","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/fallback","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/formatter","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/formatters/intl-messageformat","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/i18next","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/loader","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/locale","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/overrides","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/precompile","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/preferences","symbols":[]},{"capabilityId":"package.lssm.tech.lib.translation.runtime","from":"@lssm-tech/lib.translation-runtime/contracts/catalog","symbols":["Locale","MessageKey","TranslationEntry","TranslationCatalogMeta","PlatformTranslationCatalog","BlueprintTranslationCatalog"]}],"scripts":{"publish:pkg":"bun publish --tolerate-republish --ignore-scripts --verbose","publish:pkg:canary":"bun publish:pkg --tag canary","build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","clean":"rm -rf dist","dev":"contractspec-bun-build dev","lint":"bun run lint:fix","lint:fix":"node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .","lint:check":"node ../../../../scripts/biome.cjs check .","prebuild":"contractspec-bun-build prebuild","test":"bun test","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@formatjs/icu-messageformat-parser":"catalog:i18n","intl-messageformat":"catalog:i18n","@lssm-tech/lib.contracts-spec-core":"workspace:^"},"devDependencies":{"@lssm-tech/tool.bun":"workspace:*","@lssm-tech/tool.typescript":"workspace:*","i18next":"catalog:i18n","typescript":"catalog:"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./contracts/catalog":"./src/contracts/catalog.ts","./contracts/i18n-factory":"./src/contracts/i18n-factory.ts","./contracts/i18n-factory-snapshot":"./src/contracts/i18n-factory-snapshot.ts","./contracts/locale":"./src/contracts/locale.ts","./contracts/registry":"./src/contracts/registry.ts","./diagnostics":"./src/diagnostics.ts","./direction":"./src/direction.ts","./fallback":"./src/fallback.ts","./formatter":"./src/formatter.ts","./formatters/intl-messageformat":"./src/formatters/intl-messageformat.ts","./i18next":"./src/i18next.ts","./loader":"./src/loader.ts","./locale":"./src/locale.ts","./overrides":"./src/overrides.ts","./precompile":"./src/precompile.ts","./preferences":"./src/preferences.ts","./snapshot":"./src/snapshot.ts","./contracts/diagnostics":"./src/contracts/diagnostics.ts","./contracts/tenant":"./src/contracts/tenant.ts","./contracts/validation":"./src/contracts/validation.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","browser":"./dist/browser/index.js","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"},"./contracts/catalog":{"types":"./dist/contracts/catalog.d.ts","browser":"./dist/browser/contracts/catalog.js","bun":"./dist/contracts/catalog.js","node":"./dist/node/contracts/catalog.js","default":"./dist/contracts/catalog.js"},"./contracts/i18n-factory":{"types":"./dist/contracts/i18n-factory.d.ts","browser":"./dist/browser/contracts/i18n-factory.js","bun":"./dist/contracts/i18n-factory.js","node":"./dist/node/contracts/i18n-factory.js","default":"./dist/contracts/i18n-factory.js"},"./contracts/i18n-factory-snapshot":{"types":"./dist/contracts/i18n-factory-snapshot.d.ts","browser":"./dist/browser/contracts/i18n-factory-snapshot.js","bun":"./dist/contracts/i18n-factory-snapshot.js","node":"./dist/node/contracts/i18n-factory-snapshot.js","default":"./dist/contracts/i18n-factory-snapshot.js"},"./contracts/locale":{"types":"./dist/contracts/locale.d.ts","browser":"./dist/browser/contracts/locale.js","bun":"./dist/contracts/locale.js","node":"./dist/node/contracts/locale.js","default":"./dist/contracts/locale.js"},"./contracts/registry":{"types":"./dist/contracts/registry.d.ts","browser":"./dist/browser/contracts/registry.js","bun":"./dist/contracts/registry.js","node":"./dist/node/contracts/registry.js","default":"./dist/contracts/registry.js"},"./diagnostics":{"types":"./dist/diagnostics.d.ts","browser":"./dist/browser/diagnostics.js","bun":"./dist/diagnostics.js","node":"./dist/node/diagnostics.js","default":"./dist/diagnostics.js"},"./direction":{"types":"./dist/direction.d.ts","browser":"./dist/browser/direction.js","bun":"./dist/direction.js","node":"./dist/node/direction.js","default":"./dist/direction.js"},"./fallback":{"types":"./dist/fallback.d.ts","browser":"./dist/browser/fallback.js","bun":"./dist/fallback.js","node":"./dist/node/fallback.js","default":"./dist/fallback.js"},"./formatter":{"types":"./dist/formatter.d.ts","browser":"./dist/browser/formatter.js","bun":"./dist/formatter.js","node":"./dist/node/formatter.js","default":"./dist/formatter.js"},"./formatters/intl-messageformat":{"types":"./dist/formatters/intl-messageformat.d.ts","browser":"./dist/browser/formatters/intl-messageformat.js","bun":"./dist/formatters/intl-messageformat.js","node":"./dist/node/formatters/intl-messageformat.js","default":"./dist/formatters/intl-messageformat.js"},"./i18next":{"types":"./dist/i18next.d.ts","browser":"./dist/browser/i18next.js","bun":"./dist/i18next.js","node":"./dist/node/i18next.js","default":"./dist/i18next.js"},"./loader":{"types":"./dist/loader.d.ts","browser":"./dist/browser/loader.js","bun":"./dist/loader.js","node":"./dist/node/loader.js","default":"./dist/loader.js"},"./locale":{"types":"./dist/locale.d.ts","browser":"./dist/browser/locale.js","bun":"./dist/locale.js","node":"./dist/node/locale.js","default":"./dist/locale.js"},"./overrides":{"types":"./dist/overrides.d.ts","browser":"./dist/browser/overrides.js","bun":"./dist/overrides.js","node":"./dist/node/overrides.js","default":"./dist/overrides.js"},"./precompile":{"types":"./dist/precompile.d.ts","browser":"./dist/browser/precompile.js","bun":"./dist/precompile.js","node":"./dist/node/precompile.js","default":"./dist/precompile.js"},"./preferences":{"types":"./dist/preferences.d.ts","browser":"./dist/browser/preferences.js","bun":"./dist/preferences.js","node":"./dist/node/preferences.js","default":"./dist/preferences.js"},"./snapshot":{"types":"./dist/snapshot.d.ts","browser":"./dist/browser/snapshot.js","bun":"./dist/snapshot.js","node":"./dist/node/snapshot.js","default":"./dist/snapshot.js"},"./contracts/diagnostics":{"types":"./dist/contracts/diagnostics.d.ts","browser":"./dist/browser/contracts/diagnostics.js","bun":"./dist/contracts/diagnostics.js","node":"./dist/node/contracts/diagnostics.js","default":"./dist/contracts/diagnostics.js"},"./contracts/tenant":{"types":"./dist/contracts/tenant.d.ts","browser":"./dist/browser/contracts/tenant.js","bun":"./dist/contracts/tenant.js","node":"./dist/node/contracts/tenant.js","default":"./dist/contracts/tenant.js"},"./contracts/validation":{"types":"./dist/contracts/validation.d.ts","browser":"./dist/browser/contracts/validation.js","bun":"./dist/contracts/validation.js","node":"./dist/node/contracts/validation.js","default":"./dist/contracts/validation.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/lib.translation-runtime","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/platform/ui/translation-runtime/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/catalog","importPath":"@lssm-tech/lib.translation-runtime/contracts/catalog","target":"./src/contracts/catalog.ts","targets":[{"conditions":[],"target":"./src/contracts/catalog.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/catalog.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/catalog.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/i18n-factory","importPath":"@lssm-tech/lib.translation-runtime/contracts/i18n-factory","target":"./src/contracts/i18n-factory.ts","targets":[{"conditions":[],"target":"./src/contracts/i18n-factory.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/i18n-factory.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/i18n-factory.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/i18n-factory-snapshot","importPath":"@lssm-tech/lib.translation-runtime/contracts/i18n-factory-snapshot","target":"./src/contracts/i18n-factory-snapshot.ts","targets":[{"conditions":[],"target":"./src/contracts/i18n-factory-snapshot.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/i18n-factory-snapshot.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/i18n-factory-snapshot.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/locale","importPath":"@lssm-tech/lib.translation-runtime/contracts/locale","target":"./src/contracts/locale.ts","targets":[{"conditions":[],"target":"./src/contracts/locale.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/locale.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/locale.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/registry","importPath":"@lssm-tech/lib.translation-runtime/contracts/registry","target":"./src/contracts/registry.ts","targets":[{"conditions":[],"target":"./src/contracts/registry.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/registry.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/registry.ts","sourceStatus":"verified source file"}]},{"subpath":"./diagnostics","importPath":"@lssm-tech/lib.translation-runtime/diagnostics","target":"./src/diagnostics.ts","targets":[{"conditions":[],"target":"./src/diagnostics.ts","sourcePath":"packages/platform/ui/translation-runtime/src/diagnostics.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/diagnostics.ts","sourceStatus":"verified source file"}]},{"subpath":"./direction","importPath":"@lssm-tech/lib.translation-runtime/direction","target":"./src/direction.ts","targets":[{"conditions":[],"target":"./src/direction.ts","sourcePath":"packages/platform/ui/translation-runtime/src/direction.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/direction.ts","sourceStatus":"verified source file"}]},{"subpath":"./fallback","importPath":"@lssm-tech/lib.translation-runtime/fallback","target":"./src/fallback.ts","targets":[{"conditions":[],"target":"./src/fallback.ts","sourcePath":"packages/platform/ui/translation-runtime/src/fallback.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/fallback.ts","sourceStatus":"verified source file"}]},{"subpath":"./formatter","importPath":"@lssm-tech/lib.translation-runtime/formatter","target":"./src/formatter.ts","targets":[{"conditions":[],"target":"./src/formatter.ts","sourcePath":"packages/platform/ui/translation-runtime/src/formatter.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/formatter.ts","sourceStatus":"verified source file"}]},{"subpath":"./formatters/intl-messageformat","importPath":"@lssm-tech/lib.translation-runtime/formatters/intl-messageformat","target":"./src/formatters/intl-messageformat.ts","targets":[{"conditions":[],"target":"./src/formatters/intl-messageformat.ts","sourcePath":"packages/platform/ui/translation-runtime/src/formatters/intl-messageformat.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/formatters/intl-messageformat.ts","sourceStatus":"verified source file"}]},{"subpath":"./i18next","importPath":"@lssm-tech/lib.translation-runtime/i18next","target":"./src/i18next.ts","targets":[{"conditions":[],"target":"./src/i18next.ts","sourcePath":"packages/platform/ui/translation-runtime/src/i18next.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/i18next.ts","sourceStatus":"verified source file"}]},{"subpath":"./loader","importPath":"@lssm-tech/lib.translation-runtime/loader","target":"./src/loader.ts","targets":[{"conditions":[],"target":"./src/loader.ts","sourcePath":"packages/platform/ui/translation-runtime/src/loader.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/loader.ts","sourceStatus":"verified source file"}]},{"subpath":"./locale","importPath":"@lssm-tech/lib.translation-runtime/locale","target":"./src/locale.ts","targets":[{"conditions":[],"target":"./src/locale.ts","sourcePath":"packages/platform/ui/translation-runtime/src/locale.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/locale.ts","sourceStatus":"verified source file"}]},{"subpath":"./overrides","importPath":"@lssm-tech/lib.translation-runtime/overrides","target":"./src/overrides.ts","targets":[{"conditions":[],"target":"./src/overrides.ts","sourcePath":"packages/platform/ui/translation-runtime/src/overrides.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/overrides.ts","sourceStatus":"verified source file"}]},{"subpath":"./precompile","importPath":"@lssm-tech/lib.translation-runtime/precompile","target":"./src/precompile.ts","targets":[{"conditions":[],"target":"./src/precompile.ts","sourcePath":"packages/platform/ui/translation-runtime/src/precompile.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/precompile.ts","sourceStatus":"verified source file"}]},{"subpath":"./preferences","importPath":"@lssm-tech/lib.translation-runtime/preferences","target":"./src/preferences.ts","targets":[{"conditions":[],"target":"./src/preferences.ts","sourcePath":"packages/platform/ui/translation-runtime/src/preferences.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/preferences.ts","sourceStatus":"verified source file"}]},{"subpath":"./snapshot","importPath":"@lssm-tech/lib.translation-runtime/snapshot","target":"./src/snapshot.ts","targets":[{"conditions":[],"target":"./src/snapshot.ts","sourcePath":"packages/platform/ui/translation-runtime/src/snapshot.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/snapshot.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/diagnostics","importPath":"@lssm-tech/lib.translation-runtime/contracts/diagnostics","target":"./src/contracts/diagnostics.ts","targets":[{"conditions":[],"target":"./src/contracts/diagnostics.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/diagnostics.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/diagnostics.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/tenant","importPath":"@lssm-tech/lib.translation-runtime/contracts/tenant","target":"./src/contracts/tenant.ts","targets":[{"conditions":[],"target":"./src/contracts/tenant.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/tenant.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/tenant.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/validation","importPath":"@lssm-tech/lib.translation-runtime/contracts/validation","target":"./src/contracts/validation.ts","targets":[{"conditions":[],"target":"./src/contracts/validation.ts","sourcePath":"packages/platform/ui/translation-runtime/src/contracts/validation.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/src/contracts/validation.ts","sourceStatus":"verified source file"}]}],"entryCount":21,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Lib Translation Runtime documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.translation-runtime","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.translation-runtime.txt"},"readme":{"status":"available","body":"# @lssm-tech/lib.translation-runtime\n\nFramework-independent runtime for ContractSpec translation contracts.\n\nStatic catalog diagnostics, translation validation (including ICU, readability,\nkeyword density and locale validation), and tenant override declarations are\navailable from `./contracts/diagnostics`, `./contracts/validation`, and\n`./contracts/tenant`. Historical ContractSpec imports forward to the same\nimplementations. Static diagnostics retain their distinct contract namespace;\nthe existing runtime `./diagnostics` API is unchanged. Private source partitions\npreserve validation ordering, issue codes, defaults and the nominal\n`TranslationRegistry` and `TranslationValidationError` identities.\n\n`@lssm-tech/lib.contracts-spec-core/translations/spec` remains the canonical source of truth for `TranslationSpec` contracts, metadata, ownership, versions, locale variants, validation, fallback declarations, and override policy. This package consumes those specs at runtime to resolve, format, cache, load, diagnose, and serialize translations across server code, React, React Native, CLIs, and tests.\n\n## Boundaries\n\n- **Spec layer:** `@lssm-tech/lib.contracts-spec-core/translations/spec`\n- **Runtime layer:** this package\n- **Formatter engine:** `MessageFormatter`, with `createIntlMessageFormatter()` backed by FormatJS/`intl-messageformat`\n- **Adapters:** React/design-system/i18next integrations consume this runtime and are optional downstream layers\n\n## Example\n\nResolve messages through the `createI18nFactory` stack, with one factory per stable `TranslationSpec.meta.key`:\n\n```ts\nimport { createI18nFactory } from \"@lssm-tech/lib.translation-runtime/contracts/i18n-factory\";\nimport { cartEn, cartFr } from \"./catalogs\";\n\nconst cartI18n = createI18nFactory({\n  specKey: \"cart.messages\",\n  catalogs: [cartEn, cartFr],\n  supportedLocales: [\"en\", \"fr\"],\n  defaultLocale: \"en\",\n});\n\ncartI18n.create(\"fr-FR\").t(\"cart.greeting\", { name: \"Alice\" });\n```\n\n`create()` resolves the requested locale within `supportedLocales` (`\"fr-FR\"` falls back to `\"fr\"`, then to `defaultLocale`), so keep that list aligned with the `locale` of each catalog. A missing message falls back to the catalog's declared `fallback` locale, then to the key itself. Root catalogs declare no `fallback`; only variants point at their parent locale.\n\n`t()` interpolates `{placeholder}` values only. Format ICU messages (plural, select, selectordinal, number, date) with the formatter engine:\n\n```ts\nimport { createIntlMessageFormatter } from \"@lssm-tech/lib.translation-runtime/formatters/intl-messageformat\";\n\nconst formatter = createIntlMessageFormatter();\nformatter\n  .compile({\n    id: \"cart.itemCount\",\n    locale: \"en\",\n    message: \"{count, plural, one {# item} other {# items}}\",\n  })\n  .format({ count: 3 }); // \"3 items\"\n```\n\n> **Removed in 1.0.0.** The `createTranslationRuntime` engine, its `./runtime`, `./registry` and `./runtime-helpers` subpaths, and the preference override-layer builders (`createTranslationRuntimeFromPreferences` and related helpers) no longer exist. Migrate render paths to `createI18nFactory`. `resolveTranslationPreferenceContext` (`./preferences`) still resolves app, workspace, team, user and request locale precedence.\n\n## SSR and hydration\n\nThe factory stack produces a versioned, framework-neutral `I18nFactoryHydrationPayload` that never aliases live catalog references:\n\n```ts\nimport {\n  createI18nFactory,\n  createI18nFactoryFromHydrationPayload,\n} from \"@lssm-tech/lib.translation-runtime/contracts/i18n-factory\";\n\n// Server (RSC / route handler)\nconst factory = createI18nFactory({\n  specKey: \"cart.messages\",\n  catalogs: [cartEn, cartFr, cartEs],\n  supportedLocales: [\"en\", \"fr\", \"es\"],\n  defaultLocale: \"en\",\n});\nconst payload = factory.hydrationPayload(requestLocale);\n// Transfer payload to the client (inline script, RSC stream, etc.)\n\n// Client: rehydrate without refetching or renegotiating locale\nconst hydrated = createI18nFactoryFromHydrationPayload(payload);\nhydrated.create(payload.snapshot.locale).t(\"cart.greeting\", { name: \"Alice\" });\n```\n\nThe payload carries only the catalogs for the resolved locale and its declared fallback chain. `createI18nFactoryFromHydrationPayload` rebuilds the factory with the default `en`/`fr`/`es` locale set and `en` default, so create the client instance with `payload.snapshot.locale` and keep catalog locales within that set when you rehydrate.\n\n`validateI18nFactorySnapshot(snapshot)` and `validateI18nFactoryHydrationPayload(payload)` return human-readable error strings for partial or unknown payloads before hydration.\n\nThe `./snapshot` helpers (`createTranslationHydrationPayload`, `createTranslationSnapshotStreamChunk`, `validateTranslationHydrationPayload`) serialize a host-assembled `TranslationRuntimeSnapshot`, which the i18next adapter can consume. `createTranslationSnapshotStreamChunk(snapshot)` returns a cloned payload that is safe to enqueue before later async catalog loads; `validateTranslationHydrationPayload(payload)` returns `invalid_snapshot` diagnostics for unsupported payloads.\n\n## Shard-scoped catalog loading\n\n`src/loader.ts` accepts an optional `specKeys?` array on `TranslationBundleLoadRequest` to load a subset of catalogs per route. Use `loadShardDelta` to fetch only the incremental shards needed on navigation:\n\n```ts\nimport {\n  computeShardDelta,\n  createStaticBundleLoader,\n  loadShardDelta,\n} from \"@lssm-tech/lib.translation-runtime/loader\";\n\nconst delta = computeShardDelta(alreadyLoadedSpecKeys, requiredSpecKeys);\n// delta = requiredSpecKeys not yet loaded\n\nconst bundleLoader = createStaticBundleLoader(allCatalogs);\nconst newCatalogs = await loadShardDelta(bundleLoader, {\n  loaded: alreadyLoadedSpecKeys,\n  required: requiredSpecKeys,\n  locales: [locale],\n});\n```\n\nAbsent `specKeys` ⇒ all keys pass (existing `{specKey, locales}` semantics unchanged).\n\n## Optimization surfaces (Model A — per-request inline payload)\n\n> **Scope: per-request inline HTML reduction.** Catalogs remain bundled and cached in the JS bundle (shipped once per deploy). These optimizations reduce the per-request inline `<script>` hydration payload — NOT total transferred bytes. The ~90% total-bytes win requires Model B (catalog code-splitting + load-bearing inline payload). See `.omc/plans/ralplan-translation-catalog-sharding-ssr.md` § \"Optimization Wave — ARCHITECTURE DECISION: Model A\".\n\n### O2/O3 — Slim inline payload + value-pool dedup\n\nEnable slim mode on your scoped hydration builder to strip spec metadata from each shard before serialization. The value-pool dedup step folds message values appearing ≥2× into a `values[]` pool; expansion is automatic on rehydration.\n\n**Realized:** `/` en 96.6 KB → 37.8 KB (−61%); `/companyos/founder` en 93.9 KB → 35.6 KB (−62%); fr routes ~−60%. No-flash (AC1) re-proven through slim+dedup path. CI budget gates: single-locale ≤ 64 KB, with-fallback ≤ 128 KB.\n\nO3 adds only ~2% over O2 (five lanes have disjoint key namespaces; ~53 pooled value strings). The projected ~41 KB en-fallback win requires a shared-base architecture follow-up.\n\n### O4 — Precompiled ICU AST fast-path (`./precompile` subpath)\n\nAt bundle build time, call `buildPrecompiledIcuCatalogFromSpecs(specs)` from `@lssm-tech/lib.translation-runtime/precompile` over your `TranslationSpec[]` set. This produces a `PrecompiledIcuCatalog` with FormatJS IR AST entries for every message. Pass `createPrecompiledIcuLookup(catalog)` as the `precompiled` option to `createIntlMessageFormatter` to activate the parse-skip fast-path:\n\n```ts\n// build step (runs once at bundle time, e.g. in your bundler plugin)\nimport {\n  buildPrecompiledIcuCatalogFromSpecs,\n  createPrecompiledIcuLookup,\n  serializePrecompiledIcuCatalog,\n} from \"@lssm-tech/lib.translation-runtime/precompile\";\n\nconst catalog = buildPrecompiledIcuCatalogFromSpecs([enMessages, frMessages]);\n// optionally serialize and ship as a build asset\nconst serialized = serializePrecompiledIcuCatalog(catalog);\n\n// runtime (wire the formatter with the precompiled lookup)\nimport { parsePrecompiledIcuCatalog, createPrecompiledIcuLookup } from \"@lssm-tech/lib.translation-runtime/precompile\";\nimport { createIntlMessageFormatter } from \"@lssm-tech/lib.translation-runtime/formatters/intl-messageformat\";\n\nconst precompiled = createPrecompiledIcuLookup(parsePrecompiledIcuCatalog(serialized));\nconst formatter = createIntlMessageFormatter({ precompiled });\n// formatter skips ICU re-parsing for any message with a precompiled entry\n```\n\nAdditive opt-in — messages without a precompiled entry fall back to the standard parser transparently. **Scope: formatter-path latency win only.** Factory proof routes use `{placeholder}` interpolation (no ICU); O4 benefits apply to ICU-heavy catalogs (plural/select/date/number).\n\n### O5b (#17) — Scoped-hydration intersection (wired, currently no-op)\n\n> **App-layer wiring — not a `translation-runtime` export.** `intersectScopedI18nHydration` and `isEffectiveReachabilityMap` are implemented in `web-application-monolith`'s scoped hydration path (`packages/apps/web-application-monolith/src/i18n/scoped-hydration.reachability.ts` and `reachability-map.loader.ts`). They compose with the loader's `loadShardDelta` but are not themselves library APIs. Do not import them from `@lssm-tech/lib.translation-runtime`.\n\nWired into `getRequestI18n` and fail-safe (pruned keys resolve via the bundled combined runtime — no flash). Currently no-op (77/129 `t()` call sites use dynamic dispatch; scanner emits retain-all map). Auto-activates if a precise reachability map ships. Zero regression.\n\n### O5 (#14) — Dead-key audit tool (`@lssm-tech/tool.i18n-prune`)\n\n`@lssm-tech/tool.i18n-prune` in `packages/tools/` walks `t('key')` call sites against a `RouteShardManifest` and reports dead keys per route. Use it in CI to surface dead-key drift. It does not drive the runtime inline payload under Model A.\n\n## Optional i18next adapter\n\ni18next is an optional downstream adapter, not the canonical ContractSpec model. Import it through the dedicated subpath so core runtime consumers do not load i18next:\n\n```ts\nimport { createInstance } from \"i18next\";\nimport {\n  createI18nextInitOptions,\n  exportContractSpecToI18next,\n} from \"@lssm-tech/lib.translation-runtime/i18next\";\n\nconst exported = exportContractSpecToI18next([cartEn, cartFr], {\n  defaultLocale: \"en\",\n  lng: requestLocale,\n  assumeIcuFormatter: true,\n});\nconst { options, diagnostics } = createI18nextInitOptions(exported);\nconst i18next = createInstance();\n\nawait i18next.init(options);\n```\n\nThe adapter exports resources as `{ [locale]: { [namespace]: { [messageKey]: string } } }`. `TranslationSpec.locale` becomes the i18next language, while the namespace defaults to the stable `TranslationSpec.meta.key`. Flat ContractSpec keys such as `\"cart.items\"` remain flat because generated init options set `keySeparator: false`.\n\nContractSpec ICU messages are exported intact. i18next does not use ICU as its default JSON format, so apps that call `i18next.t()` for ICU plural/select/selectordinal messages must install and configure an ICU-capable i18next format plugin such as `i18next-icu`. The adapter reports `i18next_icu_plugin_required` unless you explicitly acknowledge that formatting layer.\n\nUse `exportTranslationSnapshotToI18next(snapshot)` when the host already assembles a `TranslationRuntimeSnapshot` (`./snapshot`); it carries the snapshot locale, default locale and fallback chain into the init options. For SSR, export from the same catalogs and locale used by the server render and reuse those resources/options on the client. Do not let client-only language detection renegotiate the first hydrated render. For React Native, pass the host-selected locale explicitly; the adapter does not use DOM APIs or browser storage.\n\n## React Native\n\nThe core runtime uses no DOM APIs. Locale detection is host-owned; pass the device or user locale to `factory.create(locale)`, or negotiate it first with `negotiateLocale({ requestedLocales, supportedLocales, defaultLocale })` from `./locale`. Ensure the host JS engine provides the required `Intl` APIs or install platform polyfills before using the default formatter.\n\n## Compatible factory and registry ownership\n\nThe registry and BCP 47 contract helpers live in this package under `./contracts/registry` and `./contracts/locale`. The pure package i18n factory and its hydration snapshot are owned by Core (`@lssm-tech/lib.contracts-spec-core/translations/i18n-factory` and `./translations/i18n-factory-snapshot`), so domain specs can use them; `./contracts/i18n-factory` and `./contracts/i18n-factory-snapshot` here forward those same implementations, with unchanged resolution. Historical ContractSpec translation imports forward these same implementations. The existing runtime root and locale exports retain their names and behavior; use the explicit contract subpaths for the factory stack. Translation declarations come from `@lssm-tech/lib.contracts-spec-core/translations/spec`.\n\n## Translation catalog model ownership\n\nThe unchanged `Locale`, `MessageKey`, `TranslationEntry`,\n`TranslationCatalogMeta`, `PlatformTranslationCatalog` and\n`BlueprintTranslationCatalog` declarations are canonical at\n`@lssm-tech/lib.translation-runtime/contracts/catalog`. Historical\n`@lssm-tech/lib.contracts-spec/translations/catalog` imports forward these\nsame declarations. The model move adds no loading, formatting or runtime\ninitialization behavior; Core continues to own `TranslationSpec`.\n","sourcePath":"packages/platform/ui/translation-runtime/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/ui/translation-runtime/README.md","blobSha":"8603faf40fad6b40d0092b3755b7e8c31f4007a5","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"README recovered byte-for-byte from pinned aggregate guide","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"ui-and-presentations","areaTitle":"Interfaces, presentations and design","displayName":"lib.translation-runtime","runtimes":["node"],"platforms":["server"],"kind":"library","scope":"Package manifest","canonicalRoute":"/docs/packages/lib.translation-runtime/","contextUrl":"/docs/packages/lib.translation-runtime.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}