Skip to content

Instantly share code, notes, and snippets.

@ErikAndreas
ErikAndreas / 0background.md
Last active December 18, 2015 16:49
Proof of concept of full stack and tooling for AngularJS i18n gettext-style using Jed, pybabel and po2json. UPDATE: will now be maintained at https://github.com/ErikAndreas/lingua and tooling at https://github.com/ErikAndreas/grunt-lingua

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:

  • "lingua", an AngularJS module wrapping Jed
  • Some AngularJS bootstrapping
  • pybabel for xgettext style translations extraction (to .pot)
  • po2json for generating .json files (per translation) from .po files