Skip to content

Commit e467025

Browse files
committed
MAGETWO-31956: PR for S42
- Refactored usages of __() method in lib to use new \Magento\Framework\Phrase()
1 parent f99a613 commit e467025

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/internal/Magento/Framework/View/Model/Layout/Merge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public function getAllDesignAbstractions()
381381
$name = $node->getAttribute('id');
382382
$info = [
383383
'name' => $name,
384-
'label' => __((string)$node->getAttribute('label')),
384+
'label' => (string)new \Magento\Framework\Phrase((string)$node->getAttribute('label')),
385385
'design_abstraction' => $node->getAttribute('design_abstraction'),
386386
];
387387
$result[$name] = $info;
@@ -780,7 +780,7 @@ public function getContainers()
780780
foreach ($containerNodes as $oneContainerNode) {
781781
$label = $oneContainerNode->getAttribute('label');
782782
if ($label) {
783-
$result[$oneContainerNode->getAttribute('name')] = __($label);
783+
$result[$oneContainerNode->getAttribute('name')] = (string)new \Magento\Framework\Phrase($label);
784784
}
785785
}
786786
return $result;

lib/internal/Magento/Framework/View/Model/Layout/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ protected function _getNodeValue(Element $node)
126126
*/
127127
protected function _translateValue($value)
128128
{
129-
return __($value);
129+
return (string)new \Magento\Framework\Phrase($value);
130130
}
131131
}

lib/internal/Magento/Framework/View/Model/Layout/Update/Validator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ protected function _initMessageTemplates()
8282
{
8383
if (!$this->_messageTemplates) {
8484
$this->_messageTemplates = [
85-
self::HELPER_ARGUMENT_TYPE => __('Helper arguments should not be used in custom layout updates.'),
86-
self::UPDATER_MODEL => __('Updater model should not be used in custom layout updates.'),
87-
self::XML_INVALID => __('Please correct the XML data and try again. %value%'),
85+
self::HELPER_ARGUMENT_TYPE => (string)new \Magento\Framework\Phrase('Helper arguments should not be used in custom layout updates.'),
86+
self::UPDATER_MODEL => (string)new \Magento\Framework\Phrase('Updater model should not be used in custom layout updates.'),
87+
self::XML_INVALID => (string)new \Magento\Framework\Phrase('Please correct the XML data and try again. %value%'),
8888
];
8989
}
9090
return $this;

0 commit comments

Comments
 (0)