Blazing fast implementation of Fluent localization language.
Project description
This is a Python implementation of Project Fluent, a localization framework designed to unleash the entire expressive power of natural language translations.
It provides a different implementation from the official fluent.runtime implementation, distinguished mainly by:
strategy: we compile FTL files to Python bytecode via AST and use exec (similar to the strategy used by projects like Mako, Jinja2 and Genshi).
speed: as a result of the above, plus static analysis, we get blazing fast performance, especially when combined with PyPy which can further optimize.
compile-time checking and error reporting.
‘escapers’ feature for handling things like HTML escaping/embedding correctly.
Installation
To install:
pip install fluent_compiler
Usage
See the docs folder or read them on readthedocs.org.
Status
The package should be considered a ‘beta’/’release candidate’. It has a very thorough test suite and good docs, and has seen usage in production as a dependency of django-ftl for a long time, but without many users.
We are not planning major backwards incompatible changes to the interface, but we’re also not guaranteeing stability yet. Also, the nature of the library is such that we expect most users will want to create their own wrappers anyway, which you are encouraged to do, in order to be able to absorb any backwards incompatible changes easily.
See the issues list for planned features.
Background
This code was originally developed as part of fluent.runtime, as an alternative implementation of FluentBundle, but never got merged to the master branch. It has now been pulled out as a separate package. This is why the repo’s history contains fluent.syntax and early versions of fluent.runtime, but the parts that are left in this repo all derive from the original version of fluent.runtime contributed by @spookylukey from a540993a085e36a9679e12f1ee7317ddc1ece5ad onwards and the new compiler implementation in d1481d61e0bc1a28a228a4b6d5258350d436e765 (which is squashed version of work done over a much longer period). Thats why we also corrected the copyright notice from Mozilla to Luke Plant.
See https://github.com/django-ftl/fluent-compiler/ for more info.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for fluent_compiler-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d7ebb23d8778f0f8dff994e7e9c7779155a8614945465b1b93fd7ad8eba8738 |
|
MD5 | 81d99a7ccf85ef3eb997c75a3e44a179 |
|
BLAKE2b-256 | 942596ac746d5ad4871048b3d7716f433884f5cf54ac565c70e76f827937e572 |
Hashes for fluent_compiler-0.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9789dfb89024cf9161580697ce72ee7aac30a74d146ec5122c876fe30c4885d5 |
|
MD5 | 06768b212302a36d17634d66bf2d258e |
|
BLAKE2b-256 | c3a8cf969f001f7a01be41e92e9853869270b295047ef5fac5c71e66a29c38a5 |