Module fluent_syntax::serializer

source ·
Expand description

Fluent Translation List serialization utilities

This modules provides a way to serialize an abstract syntax tree representing a Fluent Translation List. Use cases include normalization and programmatic manipulation of a Fluent Translation List.

§Example

use fluent_syntax::parser;
use fluent_syntax::serializer;

let ftl = r#"# This is a message comment
hello-world = Hello World!
"#;

let resource = parser::parse(ftl).expect("Failed to parse an FTL resource.");

let serialized = serializer::serialize(&resource);

assert_eq!(ftl, serialized);

Structs§

  • Options for serializing an abstract syntax tree.

Functions§

  • Serializes an abstract syntax tree representing a Fluent Translation List into a String.
  • Serializes an abstract syntax tree representing a Fluent Translation List into a String accepting custom options.