Name Description Size
__init__.py 446
parse.py Parse a .ftl file into a message resource. Message and term references are represented by `message` function annotations, with term identifiers prefixed with a `-`. Attribute values are assigned to the Entry.properties. Messages with no value will have an empty pattern assigned as their Entry.value. Function names are lower-cased, so e.g. the Fluent `NUMBER` is `number` in the Resource. The parsed resource will not include any metadata. 15736
serialize.py Serialize a resource as the contents of a Fluent FTL file. Section identifiers and multi-part message identifiers are not supported. Function names are upper-cased, and expressions using the `message` function are mapped to message and term references. Yields each entry and comment separately. If the resource includes any metadata, a `serialize_metadata` callable must be provided to map each field into a comment value, or to discard it by returning an empty value. 14450