Skip to main content

Crate es_fluent_generate

Crate es_fluent_generate 

Source
Expand description

Docs Crates.io

§es-fluent-generate

Internal Crate: Fluent file generation, merging, cleaning, and formatting logic.

This crate turns FtlTypeInfo inventories into deterministic .ftl files. It powers the CLI’s runner-backed generate and clean flows and also exposes the formatting helpers used by the CLI’s direct format command.

§What it does

  • Generates fallback-locale .ftl files from registered Rust types
  • Merges updates into existing files without discarding manual translations or comments in conservative mode
  • Removes orphaned generated keys in aggressive and clean flows
  • Prunes stale namespaced .ftl files during clean runs when a namespace no longer has any registered Rust types
  • Splits output into namespaced files when type metadata requests it
  • Sorts and normalizes Fluent AST output for reproducible diffs

§Who should use it

Most users should use es-fluent-cli instead. Depend on es-fluent-generate directly only if you are building custom tooling that needs the workspace’s FTL merge and formatting behavior.

Modules§

clean
error
formatting
ftl
value

Enums§

FluentParseMode
The mode to use when parsing Fluent files.

Functions§

generate
Generates a Fluent translation file from a list of FtlTypeInfo objects.