alexanderwallin / node-gettext

A JavaScript implementation of gettext, a localization framework.
Other
188 stars 37 forks source link

handle PO comments #13

Closed smhg closed 11 years ago

smhg commented 11 years ago

I noticed handling comments in PO files is still on your TODO list. This is something we would need for handlebars-xgettext.

Comments would be used (as poEdit does, I assume) to link results from Handlebars templates to existing PO content.

What do you need to read & write them in node-gettext? Is it your intention to handle the majority of the tracking (update/remove/add) too? Could in that case read-write be a first step?

If you want to, I could try to contribute. But in that case your feedback is even more useful.

andris9 commented 11 years ago

Hey, there were some support for reading comments from PO files but it was not exposed. I enabled it with method getComments(domain, context, msgId), see this test and this PO file for an example. Writing comments is currently not implemented in any way.

andris9 commented 11 years ago

But while I was on it, I also added the option to set comments with setComment and when PO file is generated, comments are added as well.

smhg commented 11 years ago

This sounds really good, thank you! I'm going to implement it right away.