Handle extracted comments in headers

This commit is contained in:
Ruben Vermeersch
2015-08-20 15:12:56 +02:00
parent 9060221403
commit b9394176b1
6 changed files with 30 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
# French translation of Link (6.x-2.9)
# Copyright (c) 2011 by the French translation team
#
#. extracted from test
msgid ""
msgstr ""
"Project-Id-Version: Link (6.x-2.9)\n"

View File

@@ -61,6 +61,9 @@ describe('Parse', function () {
assert.notEqual(po, null);
assert.equal(po.items.length, 2);
assert.equal(po.extractedComments.length, 1);
assert.equal(po.extractedComments[0], 'extracted from test');
var item = po.items[0];
assert.equal(item.msgid, 'Title, as plain text');
assert.equal(item.msgstr, 'Attribut title, en tant que texte brut');

View File

@@ -74,6 +74,7 @@ describe('Write', function () {
var input = fs.readFileSync(__dirname + '/fixtures/comment.po', 'utf8');
var po = PO.parse(input);
var str = po.toString();
assertHasLine(str, '#. extracted from test');
assertHasLine(str, '#. Extracted comment');
});