| @@ -192,6 +192,12 @@ PO.Item.prototype.toString = function () { | |||||||
|         return lines; |         return lines; | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|  |     if (this.comments.length > 0) { | ||||||
|  |         this.comments.forEach(function (c) { | ||||||
|  |             lines.push('# ' + c); | ||||||
|  |         }); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     if (this.references.length > 0) { |     if (this.references.length > 0) { | ||||||
|         this.references.forEach(function (ref) { |         this.references.forEach(function (ref) { | ||||||
|             lines.push('#: ' + ref); |             lines.push('#: ' + ref); | ||||||
|   | |||||||
| @@ -38,6 +38,13 @@ describe('Write', function () { | |||||||
|         assertHasLine(str, "msgstr \"Source\""); |         assertHasLine(str, "msgstr \"Source\""); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  |     it('write translator comment', function () { | ||||||
|  |         var input = fs.readFileSync(__dirname + '/fixtures/comment.po', 'utf8'); | ||||||
|  |         var po = PO.parse(input); | ||||||
|  |         var str = po.toString(); | ||||||
|  |         assertHasLine(str, "# Comment"); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     describe('msgctxt', function () { |     describe('msgctxt', function () { | ||||||
|         it('should write context field to file', function () { |         it('should write context field to file', function () { | ||||||
|             var input = fs.readFileSync(__dirname + '/fixtures/big.po', 'utf8'); |             var input = fs.readFileSync(__dirname + '/fixtures/big.po', 'utf8'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user