Fixed parsing error.

This commit is contained in:
Mike Holly 2012-01-01 17:52:51 -08:00
parent 30a0f12f9d
commit 1e13e78654
2 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,7 @@ PO.prototype.save = function(filename, callback) {
fs.writeFile(filename, this.toString(), function(err){ fs.writeFile(filename, this.toString(), function(err){
if (err) throw err; if (err) throw err;
callback && callback(); callback && callback();
}) });
}; };
PO.prototype.toString = function() { PO.prototype.toString = function() {
@ -64,6 +64,7 @@ PO.Item = function() {
this.references = []; this.references = [];
this.msgid_plural = null; this.msgid_plural = null;
this.msgstr = []; this.msgstr = [];
this.comments = [];
}; };
PO.Item.prototype.toString = function() { PO.Item.prototype.toString = function() {
@ -112,7 +113,7 @@ PO.Item.prototype.toString = function() {
PO.Item.parse = function(chunk) { PO.Item.parse = function(chunk) {
var item = new PO.Item(); var item = new PO.Item();
var parts = chunk.split(/\nmsg/); var parts = chunk.split(/msg/);
var _extract = function(string) { var _extract = function(string) {
var lines = string.split(/\n/); var lines = string.split(/\n/);

View File

@ -1,7 +1,7 @@
{ {
"name" : "node-po", "name" : "node-po",
"description" : "Simple library for loading and saving Gettext PO files.", "description" : "Simple library for loading and saving Gettext PO files.",
"version" : "0.0.2", "version" : "0.0.4",
"author" : "Mike Holly", "author" : "Mike Holly",
"homepage" : "http://github.com/mikejholly/node-po", "homepage" : "http://github.com/mikejholly/node-po",
"repository" : {"type" : "git", "url" : "http://github.com/mikejholly/node-po.git"}, "repository" : {"type" : "git", "url" : "http://github.com/mikejholly/node-po.git"},