Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
fchris82 committed Jan 4, 2017
2 parents 5a5d05f + 678c09e commit 91b30d3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Translation/Dumper/XliffDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ public function dump(MessageCatalogue $catalogue, $domain = 'messages', $filePat

if ($message->hasNotes()) {
foreach ($message->getNotes() as $note) {
$noteNode = $unit->appendChild($doc->createElement('note', $note['text']));
$noteNode = $unit->appendChild($doc->createElement('note'));
if (preg_match('/[<>&]/', $note['text'])) {
$noteNode->appendChild($doc->createCDATASection($note['text']));
} else {
$noteNode->appendChild($doc->createTextNode($note['text']));
}
if (isset($note['from'])) {
$noteNode->setAttribute('from', $note['from']);
}
Expand Down Expand Up @@ -234,7 +239,12 @@ public function dump(MessageCatalogue $catalogue, $domain = 'messages', $filePat
}

if ($meaning = $message->getMeaning()) {
$unit->appendChild($doc->createElement('note', $meaning));
$unit->appendChild($meaningNode = $doc->createElement('note'));
if (preg_match('/[<>&]/', $meaning)) {
$meaningNode->appendChild($doc->createCDATASection($meaning));
} else {
$meaningNode->appendChild($doc->createTextNode($meaning));
}
}
}

Expand Down

0 comments on commit 91b30d3

Please sign in to comment.