Code Monkey home page Code Monkey logo

fluent-compiler's Introduction

fluent-compiler

https://readthedocs.org/projects/fluent-compiler/badge/?version=latest&style=flat

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, even more so 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.

If you are using Django, see django-ftl which wraps the functionality here in Django-specific ways.

See history for a CHANGELOG.

Status

fluent-compiler is a complete and very mature implementation of all the Fluent spec up to version 1.0 (the latest at the time of writing).

In terms of API of this package, we are not planning backwards incompatible changes to the publicly documented interfaces, and will provide deprecation warnings for any changes.

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, and CONTRIBUTING.rst for information about how to contribute, and the architecture docs.

Contributing

Check out the contributing docs and the architecture notes for information that will help you before you start hacking.

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.

fluent-compiler's People

Contributors

spookylukey avatar stasm avatar pike avatar samylovma avatar zbraniecki avatar flodolo avatar mathjazz avatar olleolleolle avatar ggindinson avatar unclenachoduh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.