2012-01-03 03:52:05 +04:00
|
|
|
function trim(string) {
|
2013-12-16 19:36:32 +04:00
|
|
|
return string.replace(/^\s+|\s+$/g, '');
|
|
|
|
}
|
2011-12-22 10:50:01 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
var PO = function () {
|
|
|
|
this.comments = [];
|
2015-08-20 16:12:56 +03:00
|
|
|
this.extractedComments = [];
|
2013-12-16 19:36:32 +04:00
|
|
|
this.headers = {};
|
2018-05-23 19:25:55 +03:00
|
|
|
this.headerOrder = [];
|
2013-12-16 19:36:32 +04:00
|
|
|
this.items = [];
|
2012-01-02 05:02:19 +04:00
|
|
|
};
|
|
|
|
|
2012-01-03 03:52:05 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
PO.prototype.toString = function () {
|
2014-06-19 16:16:30 +04:00
|
|
|
var lines = [];
|
2012-01-03 03:52:05 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
if (this.comments) {
|
|
|
|
this.comments.forEach(function (comment) {
|
2017-03-17 13:29:27 +03:00
|
|
|
lines.push(('# ' + comment).trim());
|
2013-12-16 19:36:32 +04:00
|
|
|
});
|
|
|
|
}
|
2015-08-20 16:12:56 +03:00
|
|
|
if (this.extractedComments) {
|
|
|
|
this.extractedComments.forEach(function (comment) {
|
2017-03-17 13:29:27 +03:00
|
|
|
lines.push(('#. ' + comment).trim());
|
2015-08-20 16:12:56 +03:00
|
|
|
});
|
|
|
|
}
|
2012-01-02 05:02:19 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
lines.push('msgid ""');
|
|
|
|
lines.push('msgstr ""');
|
|
|
|
|
2014-06-19 16:16:30 +04:00
|
|
|
var self = this;
|
2018-05-23 19:25:55 +03:00
|
|
|
var headerOrder = [];
|
|
|
|
|
|
|
|
this.headerOrder.forEach(function (key) {
|
|
|
|
if (key in self.headers) {
|
|
|
|
headerOrder.push(key);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var keys = Object.keys(this.headers);
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
keys.forEach(function (key) {
|
2018-05-23 19:25:55 +03:00
|
|
|
if (headerOrder.indexOf(key) === -1) {
|
|
|
|
headerOrder.push(key);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
headerOrder.forEach(function (key) {
|
2014-06-19 16:16:30 +04:00
|
|
|
lines.push('"' + key + ': ' + self.headers[key] + '\\n"');
|
2013-12-16 19:36:32 +04:00
|
|
|
});
|
2012-01-02 05:02:19 +04:00
|
|
|
|
2011-12-23 04:12:01 +04:00
|
|
|
lines.push('');
|
2012-01-02 05:02:19 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
this.items.forEach(function (item) {
|
|
|
|
lines.push(item.toString());
|
|
|
|
lines.push('');
|
|
|
|
});
|
|
|
|
|
2014-06-19 16:16:30 +04:00
|
|
|
return lines.join('\n');
|
2011-12-22 10:50:01 +04:00
|
|
|
};
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
PO.parse = function (data) {
|
2013-09-12 15:01:37 +04:00
|
|
|
//support both unix and windows newline formats.
|
|
|
|
data = data.replace(/\r\n/g, '\n');
|
2014-06-19 16:16:30 +04:00
|
|
|
var po = new PO();
|
|
|
|
var sections = data.split(/\n\n/);
|
2015-09-22 11:40:49 +03:00
|
|
|
var headers = [];
|
2015-09-21 10:13:43 +03:00
|
|
|
//everything until the first 'msgid ""' is considered header
|
2015-09-22 11:40:49 +03:00
|
|
|
while (sections[0] && (headers.length === 0 || headers[headers.length - 1].indexOf('msgid ""') < 0)) {
|
2021-12-01 11:48:24 +03:00
|
|
|
if (sections[0].match(/msgid\s+"[^"]/)) {
|
2015-09-22 11:40:49 +03:00
|
|
|
//found first real string, adding a dummy header item
|
|
|
|
headers.push('msgid ""');
|
|
|
|
} else {
|
|
|
|
headers.push(sections.shift());
|
|
|
|
}
|
2015-09-21 10:13:43 +03:00
|
|
|
}
|
|
|
|
headers = headers.join('\n');
|
2014-06-19 16:16:30 +04:00
|
|
|
var lines = sections.join('\n').split(/\n/);
|
2013-12-16 19:36:32 +04:00
|
|
|
|
|
|
|
po.headers = {
|
|
|
|
'Project-Id-Version': '',
|
|
|
|
'Report-Msgid-Bugs-To': '',
|
|
|
|
'POT-Creation-Date': '',
|
|
|
|
'PO-Revision-Date': '',
|
|
|
|
'Last-Translator': '',
|
|
|
|
'Language': '',
|
|
|
|
'Language-Team': '',
|
|
|
|
'Content-Type': '',
|
|
|
|
'Content-Transfer-Encoding': '',
|
|
|
|
'Plural-Forms': '',
|
|
|
|
};
|
2018-05-23 19:25:55 +03:00
|
|
|
po.headerOrder = [];
|
2013-12-16 19:36:32 +04:00
|
|
|
|
2014-03-21 13:14:00 +04:00
|
|
|
headers.split(/\n/).reduce(function (acc, line) {
|
|
|
|
if (acc.merge) {
|
|
|
|
//join lines, remove last resp. first "
|
|
|
|
line = acc.pop().slice(0, -1) + line.slice(1);
|
|
|
|
delete acc.merge;
|
|
|
|
}
|
|
|
|
if (/^".*"$/.test(line) && !/^".*\\n"$/.test(line)) {
|
|
|
|
acc.merge = true;
|
|
|
|
}
|
|
|
|
acc.push(line);
|
|
|
|
return acc;
|
|
|
|
}, []).forEach(function (header) {
|
2015-08-20 16:12:56 +03:00
|
|
|
if (header.match(/^#\./)) {
|
|
|
|
po.extractedComments.push(header.replace(/^#\.\s*/, ''));
|
|
|
|
} else if (header.match(/^#/)) {
|
2013-12-16 19:36:32 +04:00
|
|
|
po.comments.push(header.replace(/^#\s*/, ''));
|
2015-08-20 16:12:56 +03:00
|
|
|
} else if (header.match(/^"/)) {
|
2013-12-16 19:36:32 +04:00
|
|
|
header = header.trim().replace(/^"/, '').replace(/\\n"$/, '');
|
2014-06-19 16:16:30 +04:00
|
|
|
var p = header.split(/:/);
|
|
|
|
var name = p.shift().trim();
|
|
|
|
var value = p.join(':').trim();
|
2013-12-16 19:36:32 +04:00
|
|
|
po.headers[name] = value;
|
2018-05-23 19:25:55 +03:00
|
|
|
po.headerOrder.push(name);
|
2013-12-16 19:36:32 +04:00
|
|
|
}
|
|
|
|
});
|
2012-01-03 03:52:05 +04:00
|
|
|
|
2017-02-13 21:19:31 +03:00
|
|
|
var parsedPluralForms = PO.parsePluralForms(po.headers['Plural-Forms']);
|
|
|
|
var nplurals = parsedPluralForms.nplurals;
|
|
|
|
var item = new PO.Item({ nplurals: nplurals });
|
2014-06-19 16:16:30 +04:00
|
|
|
var context = null;
|
|
|
|
var plural = 0;
|
|
|
|
var obsoleteCount = 0;
|
|
|
|
var noCommentLineCount = 0;
|
2012-01-02 05:02:19 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
function finish() {
|
|
|
|
if (item.msgid.length > 0) {
|
2014-06-19 15:38:07 +04:00
|
|
|
if (obsoleteCount >= noCommentLineCount) {
|
|
|
|
item.obsolete = true;
|
|
|
|
}
|
|
|
|
obsoleteCount = 0;
|
|
|
|
noCommentLineCount = 0;
|
2013-12-16 19:36:32 +04:00
|
|
|
po.items.push(item);
|
2017-02-13 21:19:31 +03:00
|
|
|
item = new PO.Item({ nplurals: nplurals });
|
2013-12-16 19:36:32 +04:00
|
|
|
}
|
2012-01-03 03:52:05 +04:00
|
|
|
}
|
2013-12-16 19:36:32 +04:00
|
|
|
|
|
|
|
function extract(string) {
|
|
|
|
string = trim(string);
|
|
|
|
string = string.replace(/^[^"]*"|"$/g, '');
|
2012-09-23 03:39:44 +04:00
|
|
|
string = string.replace(/\\([abtnvfr'"\\?]|([0-7]{3})|x([0-9a-fA-F]{2}))/g, function (match, esc, oct, hex) {
|
|
|
|
if (oct) {
|
|
|
|
return String.fromCharCode(parseInt(oct, 8));
|
|
|
|
}
|
|
|
|
if (hex) {
|
|
|
|
return String.fromCharCode(parseInt(hex, 16));
|
|
|
|
}
|
|
|
|
switch (esc) {
|
|
|
|
case 'a':
|
|
|
|
return '\x07';
|
|
|
|
case 'b':
|
|
|
|
return '\b';
|
|
|
|
case 't':
|
|
|
|
return '\t';
|
|
|
|
case 'n':
|
|
|
|
return '\n';
|
|
|
|
case 'v':
|
|
|
|
return '\v';
|
|
|
|
case 'f':
|
|
|
|
return '\f';
|
|
|
|
case 'r':
|
|
|
|
return '\r';
|
|
|
|
default:
|
|
|
|
return esc;
|
|
|
|
}
|
|
|
|
});
|
2013-12-16 19:36:32 +04:00
|
|
|
return string;
|
2012-01-03 03:52:05 +04:00
|
|
|
}
|
2013-12-16 19:36:32 +04:00
|
|
|
|
|
|
|
while (lines.length > 0) {
|
2014-06-19 16:16:30 +04:00
|
|
|
var line = trim(lines.shift());
|
|
|
|
var lineObsolete = false;
|
|
|
|
var add = false;
|
2014-03-07 13:15:50 +04:00
|
|
|
|
|
|
|
if (line.match(/^#\~/)) { // Obsolete item
|
2014-06-19 15:38:07 +04:00
|
|
|
//only remove the obsolte comment mark, here
|
|
|
|
//might be, this is a new item, so
|
|
|
|
//only remember, this line is marked obsolete, count after line is parsed
|
2014-03-07 13:15:50 +04:00
|
|
|
line = trim(line.substring(2));
|
2014-06-19 15:38:07 +04:00
|
|
|
lineObsolete = true;
|
2014-03-07 13:15:50 +04:00
|
|
|
}
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
if (line.match(/^#:/)) { // Reference
|
|
|
|
finish();
|
|
|
|
item.references.push(trim(line.replace(/^#:/, '')));
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (line.match(/^#,/)) { // Flags
|
2013-12-17 18:04:44 +04:00
|
|
|
finish();
|
2014-06-19 16:16:30 +04:00
|
|
|
var flags = trim(line.replace(/^#,/, '')).split(',');
|
2013-12-17 18:04:44 +04:00
|
|
|
for (var i = 0; i < flags.length; i++) {
|
|
|
|
item.flags[flags[i]] = true;
|
|
|
|
}
|
2014-06-19 19:04:03 +04:00
|
|
|
} else if (line.match(/^#($|\s+)/)) { // Translator comment
|
2013-12-16 19:36:32 +04:00
|
|
|
finish();
|
2014-06-19 19:04:03 +04:00
|
|
|
item.comments.push(trim(line.replace(/^#($|\s+)/, '')));
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (line.match(/^#\./)) { // Extracted comment
|
2014-03-02 22:11:37 +04:00
|
|
|
finish();
|
|
|
|
item.extractedComments.push(trim(line.replace(/^#\./, '')));
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (line.match(/^msgid_plural/)) { // Plural form
|
2013-12-16 19:36:32 +04:00
|
|
|
item.msgid_plural = extract(line);
|
|
|
|
context = 'msgid_plural';
|
2014-06-19 15:38:07 +04:00
|
|
|
noCommentLineCount++;
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (line.match(/^msgid/)) { // Original
|
2013-12-16 19:36:32 +04:00
|
|
|
finish();
|
|
|
|
item.msgid = extract(line);
|
|
|
|
context = 'msgid';
|
2014-06-19 15:38:07 +04:00
|
|
|
noCommentLineCount++;
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (line.match(/^msgstr/)) { // Translation
|
2013-12-16 19:36:32 +04:00
|
|
|
var m = line.match(/^msgstr\[(\d+)\]/);
|
|
|
|
plural = m && m[1] ? parseInt(m[1]) : 0;
|
|
|
|
item.msgstr[plural] = extract(line);
|
|
|
|
context = 'msgstr';
|
2014-06-19 15:38:07 +04:00
|
|
|
noCommentLineCount++;
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (line.match(/^msgctxt/)) { // Context
|
2014-01-21 16:44:52 +04:00
|
|
|
finish();
|
|
|
|
item.msgctxt = extract(line);
|
2017-11-21 14:29:28 +03:00
|
|
|
context = 'msgctxt';
|
2014-06-19 15:38:07 +04:00
|
|
|
noCommentLineCount++;
|
2014-06-19 16:16:30 +04:00
|
|
|
} else { // Probably multiline string or blank
|
2013-12-16 19:36:32 +04:00
|
|
|
if (line.length > 0) {
|
2014-06-19 15:38:07 +04:00
|
|
|
noCommentLineCount++;
|
2013-12-16 19:36:32 +04:00
|
|
|
if (context === 'msgstr') {
|
|
|
|
item.msgstr[plural] += extract(line);
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (context === 'msgid') {
|
2013-12-16 19:36:32 +04:00
|
|
|
item.msgid += extract(line);
|
2014-06-19 16:16:30 +04:00
|
|
|
} else if (context === 'msgid_plural') {
|
2013-12-16 19:36:32 +04:00
|
|
|
item.msgid_plural += extract(line);
|
2017-11-21 14:29:28 +03:00
|
|
|
} else if (context === 'msgctxt') {
|
|
|
|
item.msgctxt += extract(line);
|
2013-12-16 19:36:32 +04:00
|
|
|
}
|
|
|
|
}
|
2012-01-03 03:52:05 +04:00
|
|
|
}
|
2014-06-19 16:16:30 +04:00
|
|
|
|
2014-06-19 15:38:07 +04:00
|
|
|
if (lineObsolete) {
|
2014-06-19 16:16:30 +04:00
|
|
|
// Count obsolete lines for this item
|
2014-06-19 15:38:07 +04:00
|
|
|
obsoleteCount++;
|
|
|
|
}
|
2012-01-03 03:52:05 +04:00
|
|
|
}
|
2013-12-16 19:36:32 +04:00
|
|
|
finish();
|
2012-01-03 03:52:05 +04:00
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
return po;
|
2011-12-22 10:50:01 +04:00
|
|
|
};
|
|
|
|
|
2017-02-13 21:19:31 +03:00
|
|
|
PO.parsePluralForms = function (pluralFormsString) {
|
|
|
|
var results = (pluralFormsString || '')
|
|
|
|
.split(';')
|
|
|
|
.reduce(function (acc, keyValueString) {
|
|
|
|
var trimmedString = keyValueString.trim();
|
|
|
|
var equalsIndex = trimmedString.indexOf('=');
|
|
|
|
var key = trimmedString.substring(0, equalsIndex).trim();
|
|
|
|
var value = trimmedString.substring(equalsIndex + 1).trim();
|
|
|
|
acc[key] = value;
|
|
|
|
return acc;
|
|
|
|
}, {});
|
|
|
|
return {
|
|
|
|
nplurals: results.nplurals,
|
|
|
|
plural: results.plural
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
PO.Item = function (options) {
|
|
|
|
var nplurals = options && options.nplurals;
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
this.msgid = '';
|
2014-01-22 17:10:15 +04:00
|
|
|
this.msgctxt = null;
|
2013-12-16 19:36:32 +04:00
|
|
|
this.references = [];
|
|
|
|
this.msgid_plural = null;
|
|
|
|
this.msgstr = [];
|
2014-03-02 22:11:37 +04:00
|
|
|
this.comments = []; // translator comments
|
|
|
|
this.extractedComments = [];
|
2013-12-17 18:04:44 +04:00
|
|
|
this.flags = {};
|
2014-03-07 13:15:50 +04:00
|
|
|
this.obsolete = false;
|
2017-02-13 21:19:31 +03:00
|
|
|
var npluralsNumber = Number(nplurals);
|
|
|
|
this.nplurals = (isNaN(npluralsNumber)) ? 2 : npluralsNumber;
|
2011-12-22 10:50:01 +04:00
|
|
|
};
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
PO.Item.prototype.toString = function () {
|
2014-06-19 16:16:30 +04:00
|
|
|
var lines = [];
|
|
|
|
var self = this;
|
2013-12-16 19:36:32 +04:00
|
|
|
|
2014-03-05 13:13:30 +04:00
|
|
|
// reverse what extract(string) method during PO.parse does
|
|
|
|
var _escape = function (string) {
|
2014-06-23 20:24:02 +04:00
|
|
|
// don't unescape \n, since string can never contain it
|
|
|
|
// since split('\n') is called on it
|
|
|
|
string = string.replace(/[\x07\b\t\v\f\r"\\]/g, function (match) {
|
|
|
|
switch (match) {
|
|
|
|
case '\x07':
|
|
|
|
return '\\a';
|
|
|
|
case '\b':
|
|
|
|
return '\\b';
|
|
|
|
case '\t':
|
|
|
|
return '\\t';
|
|
|
|
case '\v':
|
|
|
|
return '\\v';
|
|
|
|
case '\f':
|
|
|
|
return '\\f';
|
|
|
|
case '\r':
|
|
|
|
return '\\r';
|
|
|
|
default:
|
|
|
|
return '\\' + match;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return string;
|
2014-03-05 13:13:30 +04:00
|
|
|
};
|
|
|
|
|
2013-12-16 19:36:32 +04:00
|
|
|
var _process = function (keyword, text, i) {
|
2014-06-19 16:16:30 +04:00
|
|
|
var lines = [];
|
|
|
|
var parts = text.split(/\n/);
|
|
|
|
var index = typeof i !== 'undefined' ? '[' + i + ']' : '';
|
2013-12-16 19:36:32 +04:00
|
|
|
if (parts.length > 1) {
|
2013-12-18 19:46:09 +04:00
|
|
|
lines.push(keyword + index + ' ""');
|
2013-12-16 19:36:32 +04:00
|
|
|
parts.forEach(function (part) {
|
2014-03-05 13:13:30 +04:00
|
|
|
lines.push('"' + _escape(part) + '"');
|
2013-12-16 19:36:32 +04:00
|
|
|
});
|
2014-06-19 16:16:30 +04:00
|
|
|
} else {
|
2014-03-05 13:13:30 +04:00
|
|
|
lines.push(keyword + index + ' "' + _escape(text) + '"');
|
2013-12-16 19:36:32 +04:00
|
|
|
}
|
|
|
|
return lines;
|
|
|
|
};
|
2012-01-02 05:02:19 +04:00
|
|
|
|
2017-09-14 15:37:45 +03:00
|
|
|
//handle \n in single-line texts (can not be handled in _escape)
|
|
|
|
var _processLineBreak = function (keyword, text, index) {
|
|
|
|
var processed = _process(keyword, text, index);
|
|
|
|
for (var i = 1; i < processed.length - 1; i++) {
|
|
|
|
processed[i] = processed[i].slice(0, -1) + '\\n"';
|
|
|
|
}
|
|
|
|
return processed;
|
|
|
|
};
|
|
|
|
|
2014-03-02 22:11:37 +04:00
|
|
|
// https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
|
|
|
|
// says order is translator-comments, extracted-comments, references, flags
|
|
|
|
|
2014-03-07 13:17:52 +04:00
|
|
|
this.comments.forEach(function (c) {
|
|
|
|
lines.push('# ' + c);
|
|
|
|
});
|
2014-03-02 02:21:18 +04:00
|
|
|
|
2014-03-07 13:17:52 +04:00
|
|
|
this.extractedComments.forEach(function (c) {
|
|
|
|
lines.push('#. ' + c);
|
|
|
|
});
|
2014-03-02 22:11:37 +04:00
|
|
|
|
2014-03-07 13:17:52 +04:00
|
|
|
this.references.forEach(function (ref) {
|
|
|
|
lines.push('#: ' + ref);
|
|
|
|
});
|
2012-01-03 04:06:32 +04:00
|
|
|
|
2015-07-17 11:35:25 +03:00
|
|
|
var flags = Object.keys(this.flags).filter(function (flag) {
|
|
|
|
return !!this.flags[flag];
|
|
|
|
}, this);
|
2013-12-17 19:35:40 +04:00
|
|
|
if (flags.length > 0) {
|
2014-06-19 16:16:30 +04:00
|
|
|
lines.push('#, ' + flags.join(','));
|
2013-12-17 19:35:40 +04:00
|
|
|
}
|
2014-06-19 15:38:07 +04:00
|
|
|
var mkObsolete = this.obsolete ? '#~ ' : '';
|
2013-12-17 19:35:40 +04:00
|
|
|
|
2014-01-21 18:06:11 +04:00
|
|
|
['msgctxt', 'msgid', 'msgid_plural', 'msgstr'].forEach(function (keyword) {
|
2014-06-19 16:16:30 +04:00
|
|
|
var text = self[keyword];
|
2013-12-16 19:36:32 +04:00
|
|
|
if (text != null) {
|
2017-02-13 21:19:31 +03:00
|
|
|
var hasTranslation = false;
|
|
|
|
if (Array.isArray(text)) {
|
|
|
|
hasTranslation = text.some(function (text) {
|
|
|
|
return text;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-02-10 06:09:42 +03:00
|
|
|
if (Array.isArray(text) && text.length > 1) {
|
2013-12-16 19:36:32 +04:00
|
|
|
text.forEach(function (t, i) {
|
2017-09-14 15:37:45 +03:00
|
|
|
var processed = _processLineBreak(keyword, t, i);
|
|
|
|
lines = lines.concat(mkObsolete + processed.join('\n' + mkObsolete));
|
2013-12-16 19:36:32 +04:00
|
|
|
});
|
2017-02-13 21:19:31 +03:00
|
|
|
} else if (self.msgid_plural && keyword === 'msgstr' && !hasTranslation) {
|
|
|
|
for (var pluralIndex = 0; pluralIndex < self.nplurals; pluralIndex++) {
|
|
|
|
lines = lines.concat(mkObsolete + _process(keyword, '', pluralIndex));
|
|
|
|
}
|
2014-06-19 16:16:30 +04:00
|
|
|
} else {
|
2017-02-10 06:40:58 +03:00
|
|
|
var index = (self.msgid_plural && Array.isArray(text)) ?
|
|
|
|
0 :
|
|
|
|
undefined;
|
2017-02-10 06:09:42 +03:00
|
|
|
text = Array.isArray(text) ? text.join() : text;
|
2017-09-14 15:37:45 +03:00
|
|
|
var processed = _processLineBreak(keyword, text, index);
|
2014-06-23 14:17:40 +04:00
|
|
|
lines = lines.concat(mkObsolete + processed.join('\n' + mkObsolete));
|
2013-12-16 19:36:32 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-19 16:16:30 +04:00
|
|
|
return lines.join('\n');
|
2011-12-23 04:17:04 +04:00
|
|
|
};
|
|
|
|
|
2013-10-31 17:13:25 +04:00
|
|
|
module.exports = PO;
|