Skip to content

Commit e4149cf

Browse files
committed
AC-3226::fixed failing testcase
1 parent 02c3b17 commit e4149cf

File tree

1 file changed

+7
-6
lines changed
  • setup/src/Magento/Setup/Module/I18n/Parser/Adapter

1 file changed

+7
-6
lines changed

setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Xml.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@
1616
class Xml extends AbstractAdapter
1717
{
1818
/**
19-
* {@inheritdoc}
19+
* @inheritdoc
2020
*/
2121
protected function _parse()
2222
{
2323
foreach ($this->_getNodes($this->_file) as $key => $element) {
24+
2425
if (!$element instanceof \SimpleXMLElement) {
2526
continue;
2627
}
2728

28-
$attributes = (string)$key ==='title' ? $element : $element->attributes();
29+
$attributes = $element->attributes();
2930

30-
if ((string)$attributes['translate'] === 'true' || (string)$attributes['translatable'] === 'true' ) {
31+
if ((string)$attributes['translate'] === 'true' || (string)$attributes['translatable'] === 'true') {
3132
$this->_addPhrase((string)$element);
32-
} else if (isset($attributes->title)) {
33+
} elseif ($key ==='title') {
3334
$this->_addPhrase((string)$element->title);
3435
} else {
3536
$this->parseTranslatableNodes($attributes, $element);
@@ -53,10 +54,10 @@ protected function _getNodes($file)
5354
$nodes = $xml->xpath('//*[@translate|@translatable]');
5455

5556
/* To add title of all xml files in translation csv */
56-
if($xml->head){
57+
if ($xml->head) {
5758
$nodes['title'] = $xml->head;
5859
}
59-
60+
6061
unset($xml);
6162

6263
return is_array($nodes) ? $nodes : [];

0 commit comments

Comments
 (0)