diff --git a/app/code/Magento/Bundle/Model/OptionRepository.php b/app/code/Magento/Bundle/Model/OptionRepository.php index 43e46ef7f1c89..9940344b5b61c 100644 --- a/app/code/Magento/Bundle/Model/OptionRepository.php +++ b/app/code/Magento/Bundle/Model/OptionRepository.php @@ -208,7 +208,7 @@ public function save( } } else { if (!$existingOption->getOptionId()) { - throw new NoSuchEntityException('Requested option doesn\'t exist'); + throw new NoSuchEntityException(__('Requested option doesn\'t exist')); } $option->setData(array_merge($existingOption->getData(), $option->getData())); diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php index f531e56482f8e..28acc5badadcf 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php @@ -223,13 +223,13 @@ protected function _getGetMethod() /** @var ParameterReflection $parameterReflection */ $parameterReflection = $methodReflection->getParameters()[0]; $body = "if (!\$id) {\n" - . " throw new \\" . InputException::class . "('ID required');\n" + . " throw new \\" . InputException::class . "(__('ID required'));\n" . "}\n" . "if (!isset(\$this->registry[\$id])) {\n" . " \$entity = \$this->" . $this->_getSourcePersistorPropertyName() . "->loadEntity(\$id);\n" . " if (!\$entity->getId()) {\n" - . " throw new \\" . NoSuchEntityException::class . "('Requested entity doesn\\'t exist');\n" + . " throw new \\" . NoSuchEntityException::class . "(__('Requested entity doesn\\'t exist'));\n" . " }\n" . " \$this->registry[\$id] = \$entity;\n" . "}\n" diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt index 1f1153c1262b0..f6eaa07988364 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt @@ -67,12 +67,12 @@ class SampleRepository implements SampleRepositoryInterface public function get($id) { if (!$id) { - throw new \Magento\Framework\Exception\InputException('ID required'); + throw new \Magento\Framework\Exception\InputException(__('ID required')); } if (!isset($this->registry[$id])) { $entity = $this->sampleInterfacePersistor->loadEntity($id); if (!$entity->getId()) { - throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist'); + throw new \Magento\Framework\Exception\NoSuchEntityException(__('Requested entity doesn\'t exist')); } $this->registry[$id] = $entity; } diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepository.txt b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepository.txt index 8e9a1907b552d..fc9be4f093a5d 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepository.txt +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/TSampleRepository.txt @@ -67,12 +67,12 @@ class TSampleRepository implements TSampleRepositoryInterface public function get(int $id) : \Magento\Framework\ObjectManager\Code\Generator\TSampleInterface { if (!$id) { - throw new \Magento\Framework\Exception\InputException('ID required'); + throw new \Magento\Framework\Exception\InputException(__('ID required')); } if (!isset($this->registry[$id])) { $entity = $this->tSampleInterfacePersistor->loadEntity($id); if (!$entity->getId()) { - throw new \Magento\Framework\Exception\NoSuchEntityException('Requested entity doesn\'t exist'); + throw new \Magento\Framework\Exception\NoSuchEntityException(__('Requested entity doesn\'t exist')); } $this->registry[$id] = $entity; }