NAME

po2json - Command line tool for converting a po file into a Gettext.js compatible json dataset

VERSION

version 0.019

SYNOPSIS

po2json /path/to/domain.po > domain.json

DESCRIPTION

This takes a PO file, as is created from GNU Gettext's xgettext, and converts it into a JSON file.

The output is an annonymous associative array. So, if you plan to load this via a <script> tag, more processing will be require (the output from this program must be assigned to a named javascript variable). For example:

echo -n "var json_locale_data = " > domain.json
po2json /path/to/domain.po >> domain.json
echo ";" >> domain.json

NAME

po2json - Convert a Uniforum format portable object file to javascript object notation.

OPTIONS

-p : pretty-print the output. Makes the output more human-readable.

BUGS

Locale::PO has a potential bug (I don't know if this actually causes a problem or not). Given a .po file with an entry like:

msgid ""
"some string"
msgstr ""

When $po->dump is run on that entry, it will output:

msgid "some string"
msgstr ""

The above is removing the first linebreak. I don't know if that is significant. If so, we'll have to rewrite using a different parser (or include our own parser).

REQUIRES

Locale::PO
JSON

SEE ALSO

Locale::PO
Gettext.js

AUTHOR

Copyright (C) 2008, Joshua I. Miller <unrtst@cpan.org>, all rights reserved. See the source code for details.

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by DuckDuckGo, Inc. http://duckduckgo.com/, Torsten Raudssus <torsten@raudss.us>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.