Use msgstr[0] when stringifying an untranslated plural item.

This commit is contained in:
rosston
2017-02-09 22:40:58 -05:00
parent 79407fcf5e
commit 115459160e
3 changed files with 83 additions and 1 deletions

View File

@@ -321,8 +321,11 @@ PO.Item.prototype.toString = function () {
lines = lines.concat(mkObsolete + _process(keyword, t, i));
});
} else {
var index = (self.msgid_plural && Array.isArray(text)) ?
0 :
undefined;
text = Array.isArray(text) ? text.join() : text;
var processed = _process(keyword, text);
var processed = _process(keyword, text, index);
//handle \n in single-line texts (can not be handled in _escape)
for (var i = 1; i < processed.length - 1; i++) {
processed[i] = processed[i].slice(0, -1) + '\\n"';