added support for multiline msgctxt strings

This commit is contained in:
Taavi Sangel 2017-11-21 13:29:28 +02:00 committed by GitHub
parent 03a257b40d
commit 579a5635a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,6 +212,7 @@ PO.parse = function (data) {
} else if (line.match(/^msgctxt/)) { // Context } else if (line.match(/^msgctxt/)) { // Context
finish(); finish();
item.msgctxt = extract(line); item.msgctxt = extract(line);
context = 'msgctxt';
noCommentLineCount++; noCommentLineCount++;
} else { // Probably multiline string or blank } else { // Probably multiline string or blank
if (line.length > 0) { if (line.length > 0) {
@ -222,6 +223,8 @@ PO.parse = function (data) {
item.msgid += extract(line); item.msgid += extract(line);
} else if (context === 'msgid_plural') { } else if (context === 'msgid_plural') {
item.msgid_plural += extract(line); item.msgid_plural += extract(line);
} else if (context === 'msgctxt') {
item.msgctxt += extract(line);
} }
} }
} }