unstale

npm / @inlang/plugin-message-format

@inlang/plugin-message-format

What changed in @inlang/plugin-message-format 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.

4 breaking5 new APIs and options2 performance1 behavior and defaults1 tooling17 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.6 on npm

@inlang/plugin-message-format 430 changes

Breaking changes 4

  • Complex messages alongside keys that share their prefix are read as written, and keys that are not messages are ignored. Values that are neither strings nor complex messages now fail import with an error naming the key.

    4.5.0release notes

  • Numeric key segments are written as object keys rather than arrays, and existing arrays with numeric message keys are read back as those messages. An existing array remains until one of its messages is edited.

    4.5.0release notes

  • Placeholders with functions are written as local declarations, preserving function names and options when messages are exported and imported. Older plugin versions read this syntax as variable names, so update the plugin everywhere project files are read.

    4.5.0release notes

  • Sorting now applies only to message keys and nested message objects; variants, declarations, and selectors retain their order, preventing catch-all variants from being selected before other variants.

    4.5.0release notes

New APIs and options 5

  • Local formatter declaration options can use $variable to reference an input variable instead of treating its name as a literal string; exported declarations round-trip as key=$variable.

    4.4.0release notes

  • Markup option and attribute values now support quoted literals using |...|.

    4.3.0release notes

  • Markup options can reference variables with key=$variable, and referenced variables are inferred in declarations.

    4.3.0release notes

  • Message patterns now support escaping literal braces with \{ and \}, and a literal backslash with \\.

    4.2.0release notes

  • Adds an optional setting to sort message keys when exporting files in ascending or descending order.

    4.1.0release notes

Performance 2

  • Imports are faster through fewer parsing operations, batched unambiguous fresh imports, preserved variant order, and cached property lookups while retaining conflict handling and partial-import behavior.

    4.5.3release notes

  • Large message-format projects import faster by indexing bundles by id.

    4.4.2release notesrelease notes

Behavior and default changes 1

  • Markup option and attribute values now support escaped | and \ characters.

    4.3.0release notes

Tooling 1

  • Publishes TypeScript declarations and explicit type exports for the plugin, making its types available to consumers.

    4.4.5release notes

Fixes and other changes 17

  • Every {locale} and legacy {languageTag} placeholder is replaced when resolving resource paths, allowing catalogs with the locale in both a directory and filename to be imported correctly.

    4.5.5release notes

  • Variants whose keys contain dots are read and written with the dot, preventing their text from being lost on the next import.

    4.5.0release notes

  • Un-annotated local declarations and quoted literal locals now import. Exact-number selectors are exported before their plural so they can win over a category that also selects that number.

    4.5.0release notes

  • When current files are passed to exportFiles, unchanged messages keep their exact text and file formatting; new messages are inserted after the preceding message, and removed messages are dropped.

    4.5.0release notes

  • The JSON plugins' helper now re-imports kept files in project load order, including exported files at the positions they replace, preventing stale overlapping messages from overriding edits on the next load.

    4.5.0release notes

  • A message whose key starts with another message's key is no longer dropped on export; it is written with the rest of its key flat in the deepest object it fits in.

    4.5.0release notes

  • A plain string stays a plain string when another locale uses a plural or select, and a placeholder declared as a local in another locale no longer adds an input declaration there.

    4.5.0release notes

  • Variants that can be selected but would lose to an earlier variant are written earlier according to MessageFormat 2 preference and locale plural rules; other variants and unchanged messages keep their order and bytes.

    4.5.0release notes

  • Fixes the file-schema export to reference published JavaScript and declarations.

    4.4.5release notes

  • Exporting no longer mutates declaration or variant-match order.

    4.4.4release notes

  • Placeholder inputs that follow existing declarations are preserved.

    4.4.4release notes

  • Whitespace around every selector match is trimmed to fix message-format round trips.

    4.4.4release notes

  • Input declarations referenced by local message-format declarations are now inferred.

    4.4.1release notes

  • Declaration options now allow optional whitespace around =, so options such as currency = $priceCurrency are not dropped.

    4.4.0release notes

  • Markup attributes now support roundtrip preservation.

    4.3.0release notes

  • Malformed markup placeholders are now validated.

    4.3.0release notes

  • Markup options now support roundtrip preservation.

    4.3.0release notes