-
Notifications
You must be signed in to change notification settings - Fork 101
FTL Serializer #182
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
Comments
We call it a It's not going to be super easy because we don't have a writable AST. See #104. You'll need to first duplicate the AST in writable form (I wouldn't mind if you offered a macro to generate read-only and RW one, or experimented with Then you'll need to replicate https://github.com/projectfluent/fluent.js/blob/master/fluent-syntax/src/serializer.ts or https://github.com/projectfluent/python-fluent/blob/master/fluent.syntax/fluent/syntax/serializer.py |
Yeah I've already looked into that. A while back I was looking at the fluent AST and wrote up a string pool which you can use to extend the lifetime of a
I might go down the path of swapping everything to There might also be some sort of reference-counted sliceable I'm not a fan of the macro route because it'll be a massive pain to implement and maintain. |
It may depend on the use case. I encourage you to look into
Same as previous. I care about edge case critical performance in ways that most use cases probably don't care as much. For that reason, I'd much rather maintain two ASTs than take any non-insignificant perf/mem hit.
That's not my experience working with macros :) I hope you're wrong! :) The bottom line is - go with |
Thanks, I forgot that fluent is used by Firefox! What operations are we wanting to benchmark? Should I be comparing just the existing parsing benchmark, or are there additional criteria that we care about? |
Michael, can you add a bit more detail on what you're trying to do? What do you want to send to GT, when, what do you expect to get back, what do you want to do with those results? I'm curious, 'cause we haven't figured that one out. |
We currently have English translations for our app and would like to add support for other languages. I'm hoping we can use machine translation to get some initial translations, then tweak them over time as people report better versions. There are a couple factors which make Google Translate feasible for us:
My plan was to:
I don't want to try anything fancy with the complex messages (i.e. something using variables like "Object { $object_number } must be a closed shape") because it'll probably mess up word order or not understand the context. There are 10-20 of these more complex messages, which is manageable enough that we can ask a human to do the translations and get results back in a reasonable amount of time. |
@Pike, my final implementation is available on GitLab, feel free to poke around the code. It works well for our purposes, but I imagine I'll be revisiting it in a couple weeks/months when we need to merge human translations with the machine generated stuff. |
I used the latest master branch and the API created in #241 and it works as expected. This issue can likely be closed now? |
At work we're planning to use Google Translate to generate some initial translations for our app. Does a pretty-printer already exist to help turn the translated
FluentMessage
s back into text form?If not, I'll put together my own and publish it to crates.io.
The text was updated successfully, but these errors were encountered: