File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
setup/src/Magento/Setup/Module/I18n/Parser/Adapter Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1616class 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 : [];
You can’t perform that action at this time.
0 commit comments