Avoid putting a space in empty comments

In our pipeline, empty comments in po files are generated without
a space after '#' and saving a po file using pofile lib generates
unwanted diff that need to be handle manually which is really annoying.
This pull request simply trim the comment line.
This commit is contained in:
Andréas Livet 2017-03-17 11:29:27 +01:00 committed by Andréas Livet
parent 9689ae5b7f
commit 0fcff887fe

View File

@ -20,12 +20,12 @@ PO.prototype.toString = function () {
if (this.comments) { if (this.comments) {
this.comments.forEach(function (comment) { this.comments.forEach(function (comment) {
lines.push('# ' + comment); lines.push(('# ' + comment).trim());
}); });
} }
if (this.extractedComments) { if (this.extractedComments) {
this.extractedComments.forEach(function (comment) { this.extractedComments.forEach(function (comment) {
lines.push('#. ' + comment); lines.push(('#. ' + comment).trim());
}); });
} }