don't remove \n characters from written po file
in Item.toString, all \n characters are removed from the output. The gettext tools however leave those characters intact. This will now produce the same output as tools like msgcat.
This commit is contained in:
parent
d202e39a60
commit
d8fc514359
@ -262,6 +262,9 @@ PO.Item.prototype.toString = function () {
|
||||
} else {
|
||||
text = isArray(text) ? text.join() : text;
|
||||
var processed = _process(keyword, text);
|
||||
for (var i = 1; i < processed.length - 1; i++) {
|
||||
processed[i] = processed[i].slice(0, -1) + '\\n"';
|
||||
}
|
||||
lines = lines.concat(mkObsolete + processed.join('\n' + mkObsolete));
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ describe('Write', function () {
|
||||
|
||||
item.msgid = '\n should be written escaped';
|
||||
assertHasLine(item.toString(), 'msgid ""');
|
||||
assertHasLine(item.toString(), '""');
|
||||
assertHasLine(item.toString(), '"\\n"');
|
||||
assertHasLine(item.toString(), '" should be written escaped"');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user