Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Translation] Add Mozilla Fluent support to Translation component #31268

Closed
flaksp opened this issue Apr 26, 2019 · 7 comments
Closed

[Translation] Add Mozilla Fluent support to Translation component #31268

flaksp opened this issue Apr 26, 2019 · 7 comments

Comments

@flaksp
Copy link

flaksp commented Apr 26, 2019

Description

Recently Mozilla released stable version of Fluent - it's specification for storing and managing translations in human-readable format. The main benefits of Fluent:

  1. It does not require any special software to manage translations because of pretty and clean syntax.
  2. It's standard.
  3. Pluralization is supported by standard.

Links:

Example

Fluent syntax looks pretty similar to YAML format used by symfony/translation, but much more flexible.

Symfony example:

apples_count: {0} There are no apples.|{1} There is one apple.|]1,Inf[ There are %count% apples.

Fluent example:

apples_count =
    { $apples_count ->
        [0] There are no apples
        [one] There is one apple
       *[other] There are { $apples_count } apples
    }.
@flaksp flaksp changed the title Add Mozilla Fluent support to Translation component [Translation] Add Mozilla Fluent support to Translation component Apr 26, 2019
@stof
Copy link
Member

stof commented Apr 26, 2019

We will have several things to consider here:

  • Fluent defines some file-level references between translations, which won't map cleanly to what Symfony Translator can do.
  • Fluent has its own syntax, so this would require loading translations in a separate catalogue to apply a special formatter on them (we already built something like that to migrate to the ICU MessageFormat in 4.2, but that one at least did not suffer from the previous point)
  • Fluent supports many formatters, as well as custom ones. The Intl formatters will provide implementations for some of them, but that would still require lots of work.

The hardest point is probably the first one. The next points are adding complexity to Symfony that we would have to maintain, but are not impossible to solve.

@javiereguiluz
Copy link
Member

My guess (not based on any objective data) is that nobody uses Fluent except Mozilla. I'd wait to see if it gains more popularity before considering to add support for it or not (keeping in mind @stof's comments too about the technical challenges of this format).

@stof
Copy link
Member

stof commented May 3, 2019

@javiereguiluz that's a double-edge argument though. Nobody will start using Fluent in the Symfony community because the Translation component does not support it.
But I agree about waiting to see whether Fluent starts getting used outside Mozilla (they only announced it publicly 2 weeks ago)

@nicolas-grekas
Copy link
Member

Is there any comparison with the intl-icu format somewhere?

@nicolas-grekas
Copy link
Member

Justification of the new format here: https://github.com/projectfluent/fluent/wiki/Fluent-and-ICU-MessageFormat

@Simperfit
Copy link
Contributor

2 month later, do we want to implement it ?

@fabpot
Copy link
Member

fabpot commented Dec 9, 2019

Let's close for now. If more people ask for it, we will reconsider.

@fabpot fabpot closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants