add parsing support for msgctxt field of poitems
The gettext format specifies a msgctxt field for translated items. An example of how to use this field has been added to the tests and the parsing of this attribute has been implemented.
This commit is contained in:
@@ -139,6 +139,10 @@ PO.parse = function (data) {
|
||||
item.msgstr[plural] = extract(line);
|
||||
context = 'msgstr';
|
||||
}
|
||||
else if (line.match(/^msgctxt/)) { // Context
|
||||
finish();
|
||||
item.msgctxt = extract(line);
|
||||
}
|
||||
else { // Probably multiline string or blank
|
||||
if (line.length > 0) {
|
||||
if (context === 'msgstr') {
|
||||
@@ -160,6 +164,7 @@ PO.parse = function (data) {
|
||||
|
||||
PO.Item = function () {
|
||||
this.msgid = '';
|
||||
this.msgctxt = '';
|
||||
this.references = [];
|
||||
this.msgid_plural = null;
|
||||
this.msgstr = [];
|
||||
|
||||
Reference in New Issue
Block a user