Been looking for a full stack including tools for gettext-style i18n with AngularJS.
- Gettext-style support in markup (html and javascript) supporting singular, plural and interpolation/sprintf
- Tooling for extraction of strings to be translated (to .pot) from html and javascript
- Tooling for generating .json of .po files
Ended up (working proof of concept) with the following:
Thanks for this nice gist! It has been very enlightening :)
I found, though, that some AngularJS syntax can break the jinja2 exctraction method. The problematic token I found is
||
(e.g.<span>{{newsItem.total_votes.votes || 0}}</span>
). Whenever the extractor finds the double pipe, it fails silently for that file, and none of the translation strings found there appears in the .pot file.Have you encountered any other problem concerning the incompatibilities between AngularJS templates and jinja2?