Fluent is a localization system designed to unleash the expressive power of the natural language.
This repository contains the specification, the reference implementation of the parser and the documentation for Fluent.
FTL is the syntax for describing translation resources in Project Fluent. FTL stands for Fluent Translation List. Read the Fluent Syntax Guide to get started learning Fluent.
The syntax/spec directory contains the formal EBNF grammar, autogenerated from the reference implementation.
The syntax/parser directory contains the reference implementation of the syntax as a LL(infinity) parser.
The format/spec directory contains the specification of formatting patterns into strings, including resolving all expressions in placeables.
The format/resolver directory contains the reference implementation of Bundle.formatPattern and the resolver.
The reference resolver is written in TypeScript and must be compiled before tests are run. The reference parser is currently still written in JavaScript.
While working on the reference implementations, use the following commands to test and validate your work:
npm run watch # Run the TypeScript compiler watcher. npm test # Test the parser against JSON AST fixtures, # and test the resolver using the examples # from the spec (the resolver must be compiled). npm run lint # Lint the parser and the resolver code. npm run pretty # Prettify the resolver code. npm run generate:ebnf # Generate the EBNF from syntax/grammar.js. npm run generate:fixtures # Generate test fixtures (FTL → JSON AST). npm run build:impls # Compile the resolver. npm run build:guide # Build the HTML version of the Guide. npm run bench # Run the performance benchmark on large FTL. This repository contains the reference implementation of Fluent. Other implementations exist which should be preferred for use in production and in tooling.
- The JavaScript implementation at
fluent.js, including the React bindings. - The Python implementation at
python-fluent. - The Rust implementation at
fluent-rs.
We also know about the following community-driven implementations:
Fluent.Netby @blushingpenguin. See #93 for more info.- A Java/Kotlin implementation has been requested in #158.
elm-fluentby @spookylukey
Find out more about Project Fluent at projectfluent.org and discuss the future of Fluent at Mozilla Discourse.