Closed jessegreenberg closed 2 weeks ago
msgid "Hello, World!"
msgstr "Hola, Mundo!"
msgctxt "greeting" msgid "Welcome, user!" msgstr "¡Bienvenido, usuario!"
msgid "You have %d message." msgid_plural "You have %d messages." msgstr[0] "Tienes %d mensaje." msgstr[1] "Tienes %d mensajes."
- .properties - Usually used in Java apps. Has support for placeholders and comments, but no support for logic or pluralization. Not typical for we apps.
- .xliff - "XML Localization Interchange File Format". Designed to standardize the way translation data is structured. It is commonly used for translation in apps. It has good support for comments and metadata. It does not support logic. One might use xliff to store strings and then use fluent to handle the logic. Less used than JSON. Its benefits are mostly for standardization, cross-platform support, and metadata.
- .xml (android) - Specific to android, not relevant for web applications. The xml file holds strings, but there isn't set up to support logic.
Next, I searched for some other JavaScript tools for i18n. I found these:
From what I found in this issue, I think our decision is between Fluent and some library that supports ICU. Here are pros/cons for each:
I don't know if the features from Fluent will be needed by translators and if they are worth using when ICU appears to be a bit more standard.
@emily-phet @terracoda @jbphet and I just met to discuss the above notes.
We agreed that Fluent is the way to go. It has more features for complex translations than libraries backed by ICU, and we do not see any drawbacks. Fluent is also widely used, so we do not feel a need to use ICU just because it may be more standard.
@emily-phet found a good write up on Fluent vs ICU: https://github.com/projectfluent/fluent/wiki/Fluent-and-ICU-MessageFormat
Granted, the authors are biased towards Fluent, but it describes the differences well.
We are going to port accessibility strings to the Fluent format in a few sims, starting with ohms-law. Then we are going to get feedback from translators to determine how successful this is.
From #985 and #986.
We looked at format.js and fluent.js, which uses file formats with built in support for translation logic. While investigating we found Pontoon - a full stack translation solution. It lists a number of supported file formats and we want to learn more about them. We should also do another broad search for any others.
From Pontoon documentation: