Object.keys(po.translations).forEach((ck) => { Object.keys(po.translations[ck]).forEach((id) => { if (id !== '') { let md5 = crypto.createHash('md5'); let msg = po.translations[ck][id]; let obj = {extensions: []}; if (msg.msgctxt && msg.msgctxt != '') { md5.update(msg.msgctxt + '\u0000' + msg.msgid, 'utf-8'); } else md5.update(msg.msgid, 'utf-8'); let oid = md5.digest('hex'); obj.id = oid; obj.extensions.push({'object-type': 'pot-entry-header', references: msg.comments && msg.comments.reference ? msg.comments.reference.split('\n') : [], flags: msg.comments && msg.comments.flag ? msg.comments.flag.split(',') : [], context: msg.msgctxt ? msg.msgctxt : ''}); if (msg.comments && msg.comments.extracted) obj.extensions.push({'object-type': 'comment', value: msg.comments.extracted, space: 'preserve'}); if (msg.msgid_plural) { obj.plural = true; obj.contents = [msg.msgid, msg.msgid_plural]; } else { obj.plural = false; obj.content = msg.msgid; if (msg.comments && msg.comments.flag && msg.comments.flag.match('fuzzy'))