Port po2json.pl to Node.js script #924
Comments
I created a po2json.js script based on the parser from Gettext.js. Aside from the order of the keys in the generated JSON, it gives identical output when run against client.po and messages.po. |
Fantastic work @zaach! i've commited your file on your behalf to Mozilla's SVN repo. Testing, the output looks great. I noticed you didn't put your name in the credits, feel free to send me another Gist and I can commit for you... or an svn patch (horror of horrors, I know). @fetep - Heads up, compile-json.sh now uses this node based build script instead of the Perl one. @mathjazz - Do you want me to keep the Perl based script around, or can l10n drivers use node based scripts? |
Thanks. I've updated the gist with my name. |
Also, I see you've licensed your contribution GPL (as the original was GPL). I'm not a lawyer... If possible, would you consider licensing your po2json.js as MPL 2.0, BSD, or LGPL? (MPL 2.0 is preferred). If you're cool with that, I"ll confirm with some legal focused people that your port is an original work that can be licensed how you see fit, or if it must stay GPL. |
Oh, sure, MPL 2.0 is fine. I just included the original to be safe.
|
Your scripts output is compatible with Gettext.js (as well as our re-written from scratch gettext.js), but you didn't really use the JavaScript in your port, right? Looking at the source, it looks inspired only by po2json.pl (and not Gettext.js). I think you might want to say |
The parse function was based on the code from Gettext.js, which in turn seemed to be heavily inspired by po2json.pl. I could do a rewrite if that's better for licensing purposes. |
This tool can stay GPL, I was hoping to move it to another license. Porting a GPL Perl program line by line to another language, is probably not enough to re-license. For bugs where we want MPL, we'll be more careful about a "from scratch" implementation. Thanks for offering to re-write that one function, no need. I've commmited your author comment update. Great work! |
Hey @ozten, we don't really use any of those scripts. We only run extract_po.sh and merge_po.sh to update the PO files, which are later converted to JSON by cron I guess. From my perspective, feel free to remove the Perl-based script. |
Verifying the original issue. Please create a new issue if you want to continue the post-closure discussion above. |
Note: This issue might become obsolete if we switch to translate-toolkit, but...
We should port the GPL Perl based po2json.pl script
http://svn.mozilla.org/projects/l10n-misc/trunk/browserid/locale/po2json.pl
The best target would be node.js without changing the output format. This way, we can let the l10n team use either our new po2json.js or the old po2json.pl.
The Identity team won't have to install Perl, etc to update strings.
Please copy input, output, and any bugs which that code has.
The text was updated successfully, but these errors were encountered: