Fixed export bug.
This commit is contained in:
30
lib/po.js
30
lib/po.js
@@ -26,7 +26,6 @@ PO.prototype.toString = function() {
|
||||
this.comments.forEach(function(comment) {
|
||||
lines.push('# ' + comment);
|
||||
});
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
lines.push('msgid ""');
|
||||
@@ -182,22 +181,23 @@ PO.Item.prototype.toString = function() {
|
||||
this.references.forEach(function(ref) {
|
||||
lines.push(util.format('#: %s', ref));
|
||||
});
|
||||
['msgid', 'msgid_plural', 'msgstr'].forEach(function(keyword) {
|
||||
var text = that[keyword];
|
||||
if (text != null) {
|
||||
if (util.isArray(text) && text.length > 1) {
|
||||
text.forEach(function(t, i) {
|
||||
lines = lines.concat(_process(keyword, t, i));
|
||||
});
|
||||
}
|
||||
else {
|
||||
text = util.isArray(text) ? text.join() : text;
|
||||
lines = lines.concat(_process(keyword, text));
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
['msgid', 'msgid_plural', 'msgstr'].forEach(function(keyword) {
|
||||
var text = that[keyword];
|
||||
if (text != null) {
|
||||
if (util.isArray(text) && text.length > 1) {
|
||||
text.forEach(function(t, i) {
|
||||
lines = lines.concat(_process(keyword, t, i));
|
||||
});
|
||||
}
|
||||
else {
|
||||
text = util.isArray(text) ? text.join() : text;
|
||||
lines = lines.concat(_process(keyword, text));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return lines.join("\n");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user