Skip to main content

Convert PO files to JSON

Project description


pojson is a tool that allows you to create JSON data (and .js) files from PO files. The JSON and .js files are compatible with the format required by Javascript Gettext. It can be used instead of the Perl-based po2json tool included in this project.

Basic use:

$ pojson convert <translation_domain> <path/to/po>

Generate .js file:

$ pojson convert -j <translation_domain> <path/to/po>

Pretty-print output:

$ pojson convert -p <translation_domain> <path/to/po>


$ pojson convert --help

Normally you would send the output to a file, such as:

$ pojson convert myproject something.po > something.json

$ pojson convert -j myproject something.po > something.js

Normally pojson will try to guess the encoding of the .po file, but you can also explicitly supply an encoding:

$ pojson convert -e utf-8 myproject something.po > something.json

Javascript Gettext:


0.3 (2011-06-02)

  • Actually got the output wrong so jsgettext couldn’t work with it. Fixed.

  • Some sanity checking that the input file has the .po extension, as evidently polib accepts any file and still gives output…

0.2 (2011-06-02)

  • Error when referring to non-existent po file

0.1 (2011-05-04)

  • Initial release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pojson-0.3.tar.gz (34.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page