projectfluent/python-fluent

Implement MessageContext and format method

spookylukey opened this issue · 3 comments

In other words, make this Python implementation able to generate translations, as mentioned in #58

I'm adding this issue as a placeholder for anyone else working on this, because I have started to tackle the problem in the 'implement_format' branch on this repo: https://github.com/django-ftl/python-fluent/tree/implement_format

I am following the Javascript implementation to a large degree, but making it more pythonic, and I'm especially leaning on the Javascript tests.

So far I have only the most basic cases covered (simple text messages, and external number/text arguments interpolated into them), but with a decent start in terms of a framework for the remainder. I don't know when I'll be able to look at this again.

I found some time, and it didn't take as long as I thought. But I really shouldn't do much more on this now!

I think I've covered most of the spec now (interpreter only, a compiler to Python would give some nice performance improvements for the common case, but will have to wait). There are some usage docs in the README, which also includes a probably incomplete list of TODO items.

I'm going to submit a PR, even though it is incomplete, as a place to do more discussion on the actual implementation.

stasm commented

Thanks, @spookylukey, I'm looking forward to the PR!

This is merged now!