diff --git a/lib/po.js b/lib/po.js index 0068547..3825b65 100644 --- a/lib/po.js +++ b/lib/po.js @@ -203,7 +203,7 @@ PO.Item.prototype.toString = function () { lines.push('#, ' + flags.join(",")); } - ['msgid', 'msgid_plural', 'msgstr'].forEach(function (keyword) { + ['msgctxt', 'msgid', 'msgid_plural', 'msgstr'].forEach(function (keyword) { var text = that[keyword]; if (text != null) { if (isArray(text) && text.length > 1) { diff --git a/test/write.js b/test/write.js index 9aece24..3a04376 100644 --- a/test/write.js +++ b/test/write.js @@ -37,4 +37,11 @@ describe('Write', function () { var str = po.toString(); assertHasLine(str, "msgstr \"Source\""); }); + + it('write msgctxt', function () { + var input = fs.readFileSync(__dirname + '/fixtures/big.po', 'utf8'); + var po = PO.parse(input); + var str = po.toString(); + assertHasLine(str, 'msgctxt "folder action"'); + }); });