Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAGETWO-77672: <![CDATA[]]>in system.xml translate phrase not work, if comment starts from new line. #11675

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private function parseTranslatableNodes(\SimpleXMLElement $attributes, \SimpleXM
{
$nodesDelimiter = strpos($attributes['translate'], ' ') === false ? ',' : ' ';
foreach (explode($nodesDelimiter, $attributes['translate']) as $value) {
$phrase = (string)$element->{$value};
$phrase = trim((string)$element->{$value});
if ($phrase) {
$this->_addPhrase($phrase);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function parseDataProvider()
['phrase' => 'Phrase 2', 'file' => $default, 'line' => '', 'quote' => ''],
['phrase' => 'Phrase 3', 'file' => $default, 'line' => '', 'quote' => ''],
['phrase' => 'Phrase 1', 'file' => $default, 'line' => '', 'quote' => ''],
['phrase' => 'Comment from new line.', 'file' => $default, 'line' => '', 'quote' => ''],
],
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
<node2>
<title translate="true">Phrase 1</title>
</node2>
<node3 translate="comment">
<comment>
<![CDATA[Comment from new line.]]>
</comment>
</node3>
</layout>