Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Port po2json.pl to Node.js script #924

Closed
ozten opened this issue Jan 20, 2012 · 10 comments
Closed

Port po2json.pl to Node.js script #924

ozten opened this issue Jan 20, 2012 · 10 comments

Comments

@ozten
Copy link
Contributor

ozten commented Jan 20, 2012

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.

@zaach
Copy link
Contributor

zaach commented Feb 4, 2012

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.

@ozten
Copy link
Contributor Author

ozten commented Feb 5, 2012

Fantastic work @zaach!

i've commited your file on your behalf to Mozilla's SVN repo.
http://viewvc.svn.mozilla.org/vc/projects/l10n-misc/trunk/browserid/README?revision=101148&view=markup

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?

@ozten ozten closed this as completed Feb 5, 2012
@zaach
Copy link
Contributor

zaach commented Feb 5, 2012

Thanks. I've updated the gist with my name.

@ozten
Copy link
Contributor Author

ozten commented Feb 5, 2012

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.

@zaach
Copy link
Contributor

zaach commented Feb 5, 2012

Oh, sure, MPL 2.0 is fine. I just included the original to be safe.
On Feb 5, 2012 2:19 PM, "Austin King" <
reply@reply.github.com>
wrote:

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.


Reply to this email directly or view it on GitHub:
#924 (comment)

@ozten
Copy link
Contributor Author

ozten commented Feb 5, 2012

PO parser from http://jsgettext.berlios.de/lib/Gettext.js
adapted for Node.js and modified to be more like po2json.pl

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
PO parser compatible with http://jsgettext.berlios.de/ project's Gettext.js and po2json.pl.
po2json.js adapted Node.js, inspired heavily by po2json.pl.

@zaach
Copy link
Contributor

zaach commented Feb 5, 2012

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.

@ozten
Copy link
Contributor Author

ozten commented Feb 6, 2012

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!

@mathjazz
Copy link
Contributor

mathjazz commented Feb 6, 2012

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.

@jbonacci
Copy link
Contributor

Verifying the original issue. Please create a new issue if you want to continue the post-closure discussion above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants