-
Notifications
You must be signed in to change notification settings - Fork 45
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
Compiling fluent #345
Comments
For Javascript, see https://github.com/eemeli/fluent-compiler - although I have significant doubts about the implementation, as I'm not convinced it is sufficiently checking input in for the case of potentially malicious ftl files. For Python, there is my fluent-compiler package, although at the moment it doesn't output Python code to save for later use, it simply uses compilation as an implementation strategy. |
Good to know. I'll have a look at both of them. |
I wrote the JS compiler a while ago, but haven't touched it in years. IIRC, it might be targeting an earlier version of the Fluent spec even. I wrote it largely following on from the JS My current main focus around this is on the Unicode MessageFormat 2 (MF2) spec, and eventually getting that to be the basis for Intl.MessageFormat in JavaScript. This is relevant for compiling messages, as it'll include a data model representation of messages which will have native formatter support in JS as well as other languages. In other words, we'll be able to compile Fluent and other syntaxes into the MF2 data model during the application build, rather than executable JS source, and feed that to a formatter provided by the runtime. |
I couldn't find any info regarding compiling fluent to the target languages.
Is it possible, for example, to transform this:
Into this (javascript implementation here);
This greatly helps reducing bundle size. It is done by messageFormat and a few others and would be great to have.
The text was updated successfully, but these errors were encountered: