Skip to main content

Fluent i18n solution for Elm

Project description

elm-fluent

https://img.shields.io/pypi/v/elm_fluent.svg https://travis-ci.org/elm-fluent/elm-fluent.svg?branch=master https://codecov.io/gh/elm-fluent/elm-fluent/branch/master/graph/badge.svg Documentation Status

elm-fluent is a Fluent implementation for Elm.

Fluent is a next-generation translation/localization solution, designed by the folks at Mozilla, based on many years of experience with localizing into a large number of different languages. Mozilla have extracted parts of their ‘l20n’ solution (used by apps like Firefox and Thunderbird) into a re-usable specification designed specifically for the web.

elm-fluent is a full implementation of this specification for Elm (see the change log for exact version support).

It operates as a command line tool that compiles .ftl files to .elm files. The result is that each message becomes a function that will generate a translated string (or HTML fragment) for a given locale and an optional set of strongly typed parameters (string, dates or numbers).

Dates and numbers can also be passed with formatting parameters supplied - for example, to attach a currency to a number, so that it can be correctly formatted as a currency according to the rules of the locale in use.

Please see the docs for more information.

For discussion regarding Fluent, including elm-fluent, see also the Mozilla Discourse Fluent category.

Status

  • Rough around the edges, but being used in production. Please see the list of open issues.

  • A pretty complete test suite, and sufficient docs.

  • Good attention to usability in terms of nice error messages.

  • Compatibility: Elm 0.18 only.

    Elm 0.19 is problematic - we require a wrapper for Intl, but Elm doesn’t have one yet and the restriction on native modules blocks us from writing our own.

    It is unclear if/when an official wrapper will be provided, or whether it will be suitable for elm-fluent. We use elm-intl which has proved ideal for our usage, but the core team apparently quickly dismissed adoption of a library like that.

    In light of this, and other problems caused by the restriction on native modules in 0.19, the author of elm-fluent may well be forced to move away from Elm. In this event the most likely outcome is a migration to bucklescript with bucklescript-tea and elm-fluent will be forked to target that platform instead. This repo will not be deleted but further development will likely stop.

  • Free software: MIT license

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.6.0 (2020-04-09)

  • Big rewrite of the type inference/checking mechanism, with more accurate error messages now.

0.5.0 (2019-08-15)

  • Updated to Syntax 1.0 (fluent.syntax 0.15)

  • Various bug fixes and small improvements

0.4.0 (2019-03-18)

  • ftl2elm –include option

  • Dropped Python 2.7 support

0.3.0 (2019-03-06)

  • Syntax 0.8 support, including parameterized terms.

  • Better compile-time resolution of some expressions.

0.2.1 (2018-12-19)

  • Fixed python-fluent dependency to an older version (< 0.9), because it doesn’t work with newer versions. Thanks @stasm for the report.

0.2.0 (2018-09-10)

  • Better handling for a large variety of error conditions

  • Proper fallback mechanism implemented

  • Added --watch option.

  • Eliminate unused imports from generated code

  • Various bug fixes:

    • Avoid outputting .elm files with no exports

    • Bugs with HTML attributes and non-string message args

    • Crasher with multi-line messages

    • Crasher when a message is missing from default locale

0.1.0 (2018-07-27)

  • First release on PyPI.

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

elm_fluent-0.6.0.tar.gz (117.9 kB view details)

Uploaded Source

Built Distribution

elm_fluent-0.6.0-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file elm_fluent-0.6.0.tar.gz.

File metadata

  • Download URL: elm_fluent-0.6.0.tar.gz
  • Upload date:
  • Size: 117.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for elm_fluent-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c85a6e63e8c50a25ff48e2d6552d2c8f4a713a990b937c5ec6ff2850cf398335
MD5 59bce1866eb90e31b5c3710f2e9eaf1b
BLAKE2b-256 7fd01b62dc44bdf53f218249281f797ec73ecac73cfbf34639d42266d111e2e6

See more details on using hashes here.

File details

Details for the file elm_fluent-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: elm_fluent-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for elm_fluent-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9f2246ae5c5e73711a9a3597d9a489c54e1bb9d180298502f0010612b186681
MD5 6c5359265dd8e1122cbe509e826b94fd
BLAKE2b-256 216805bc34792bce7891a7c4355808741958a65bd26813aac93dcd9b2221c1e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page