Comparing version 0.2.6 to 0.2.7
@@ -92,3 +92,4 @@ var fs = require('fs'), | ||
context = null, | ||
plural = 0; | ||
plural = 0, | ||
obsolete = false; | ||
@@ -99,2 +100,4 @@ function finish() { | ||
item = new PO.Item(); | ||
item.obsolete = obsolete; | ||
obsolete = false; | ||
} | ||
@@ -114,2 +117,10 @@ } | ||
add = false; | ||
if (line.match(/^#\~/)) { // Obsolete item | ||
obsolete = true; | ||
line = trim(line.substring(2)); | ||
} else { | ||
obsolete = false; | ||
} | ||
if (line.match(/^#:/)) { // Reference | ||
@@ -181,2 +192,3 @@ finish(); | ||
this.flags = {}; | ||
this.obsolete = false; | ||
}; | ||
@@ -213,19 +225,13 @@ | ||
if (this.comments.length > 0) { | ||
this.comments.forEach(function (c) { | ||
lines.push('# ' + c); | ||
}); | ||
} | ||
this.comments.forEach(function (c) { | ||
lines.push('# ' + c); | ||
}); | ||
if (this.extractedComments.length > 0) { | ||
this.extractedComments.forEach(function (c) { | ||
lines.push('#. ' + c); | ||
}); | ||
} | ||
this.extractedComments.forEach(function (c) { | ||
lines.push('#. ' + c); | ||
}); | ||
if (this.references.length > 0) { | ||
this.references.forEach(function (ref) { | ||
lines.push('#: ' + ref); | ||
}); | ||
} | ||
this.references.forEach(function (ref) { | ||
lines.push('#: ' + ref); | ||
}); | ||
@@ -252,5 +258,9 @@ var flags = Object.keys(this.flags); | ||
return lines.join("\n"); | ||
if (this.obsolete) { | ||
return "#~ " + lines.join("\n#~ "); | ||
} else { | ||
return lines.join("\n"); | ||
} | ||
}; | ||
module.exports = PO; |
{ | ||
"name": "pofile", | ||
"description": "Parse and serialize Gettext PO files.", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Ruben Vermeersch", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14127
227