Meet jsgettext. It is basically a boiled down version of the usual gettext tool that is used everywhere in nearly every programming language. It supports the standard gettext functions, including the one using contexts or plural forms.
Unfortunately, I found that the documentation of its usage was quite limited. This is why I uploaded here a sample app that gets its text translated in 3 different parts:
- In the Python code.
- In the Jinga templates.
Each part include examples of translations including placeholders and/or plural forms.
You can find the code attached to this post, but for convenience I've also uploaded it on GitHub: