docs

Catalog API

@linguanahq/catalog is the shared contract between compiler, API, translation workflow, and React runtime. Its current SCHEMA_VERSION is 1.0.

Schemas and types

The package exports Zod schemas and inferred types for message locations, placeholders, message context, manifest messages, diagnostics, manifests, and catalogs.

Identity and hashing

  • normalizeSource(source) creates the semantic identity input.
  • parseMessagePlaceholders(source) parses ICU placeholders.
  • stableMessageId(input) combines source locale, source, context, and optional explicit ID.
  • contentHash(value) hashes canonical JSON.
  • manifestHash(manifest) hashes manifest content.

Formatting-only source changes should preserve normalized identity. Context or explicit ID changes may intentionally create a different message.

Catalog integrity

createCatalog(input) adds integrity evidence to an immutable catalog. verifyCatalog(catalog) recomputes and checks it. The runtime additionally verifies requested project, environment, and locale before rendering.

Compatibility

Keep catalog, compiler, server, and runtime versions aligned. A schema parse or integrity failure is a hard rejection, not a warning that may be ignored.

See also

Find text in your app · Show translated content

Did this page get you to a working result?

On this page

No Headings