Parse item flags.

This commit is contained in:
Ruben Vermeersch
2013-12-17 15:04:44 +01:00
parent b2e53d790b
commit fff8349e25
3 changed files with 40 additions and 0 deletions

View File

@@ -113,6 +113,13 @@ PO.parse = function (data) {
finish();
item.references.push(trim(line.replace(/^#:/, '')));
}
else if (line.match(/^#,/)) { // Flags
finish();
var flags = trim(line.replace(/^#,/, '')).split(",");
for (var i = 0; i < flags.length; i++) {
item.flags[flags[i]] = true;
}
}
else if (line.match(/^#/)) { // Comment
finish();
item.comments.push(trim(line.replace(/^#/, '')));
@@ -157,6 +164,7 @@ PO.Item = function () {
this.msgid_plural = null;
this.msgstr = [];
this.comments = [];
this.flags = {};
};
PO.Item.prototype.toString = function () {