diff --git a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php index c10ff421b7f92..949e5e0a08f51 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php @@ -189,6 +189,8 @@ public function renderArray($addressAttributes, $format = null) $data[$key] = $v; } } + if (in_array($attributeCode, ['prefix', 'suffix'])) + $value = __($value); $data[$attributeCode] = $value; } } diff --git a/app/code/Magento/Customer/Helper/View.php b/app/code/Magento/Customer/Helper/View.php index a47930abb6d0e..4fcb9cf7552f4 100644 --- a/app/code/Magento/Customer/Helper/View.php +++ b/app/code/Magento/Customer/Helper/View.php @@ -41,7 +41,7 @@ public function getCustomerName(CustomerInterface $customerData) $name = ''; $prefixMetadata = $this->_customerMetadataService->getAttributeMetadata('prefix'); if ($prefixMetadata->isVisible() && $customerData->getPrefix()) { - $name .= $customerData->getPrefix() . ' '; + $name .= __($customerData->getPrefix()) . ' '; } $name .= $customerData->getFirstname(); @@ -55,7 +55,7 @@ public function getCustomerName(CustomerInterface $customerData) $suffixMetadata = $this->_customerMetadataService->getAttributeMetadata('suffix'); if ($suffixMetadata->isVisible() && $customerData->getSuffix()) { - $name .= ' ' . $customerData->getSuffix(); + $name .= ' ' . __($customerData->getSuffix()); } return $name; } diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index 8421fc92f8c4a..9d7465f8ed5bf 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -194,7 +194,7 @@ public function getName() { $name = ''; if ($this->_eavConfig->getAttribute('customer_address', 'prefix')->getIsVisible() && $this->getPrefix()) { - $name .= $this->getPrefix() . ' '; + $name .= __($this->getPrefix()) . ' '; } $name .= $this->getFirstname(); $middleName = $this->_eavConfig->getAttribute('customer_address', 'middlename'); @@ -203,7 +203,7 @@ public function getName() } $name .= ' ' . $this->getLastname(); if ($this->_eavConfig->getAttribute('customer_address', 'suffix')->getIsVisible() && $this->getSuffix()) { - $name .= ' ' . $this->getSuffix(); + $name .= ' ' . __($this->getSuffix()); } return $name; } diff --git a/app/code/Magento/Customer/Model/Options.php b/app/code/Magento/Customer/Model/Options.php index 4c9b9f97ad43a..3f2fa1bb5cf9d 100644 --- a/app/code/Magento/Customer/Model/Options.php +++ b/app/code/Magento/Customer/Model/Options.php @@ -101,7 +101,8 @@ private function prepareNamePrefixSuffixOptions($options, $isOptional = false) $result = []; $options = explode(';', $options); foreach ($options as $value) { - $result[] = $this->escaper->escapeHtml(trim($value)) ?: ' '; + $value = $this->escaper->escapeHtml(trim($value)) ?: ' '; + $result[] = __($value); } if ($isOptional && trim(current($options))) { diff --git a/app/code/Magento/Sales/Model/Order/Address.php b/app/code/Magento/Sales/Model/Order/Address.php index 0fd4555238ed5..f46f1369d3539 100644 --- a/app/code/Magento/Sales/Model/Order/Address.php +++ b/app/code/Magento/Sales/Model/Order/Address.php @@ -142,7 +142,7 @@ public function getName() { $name = ''; if ($this->getPrefix()) { - $name .= $this->getPrefix() . ' '; + $name .= __($this->getPrefix()) . ' '; } $name .= $this->getFirstname(); if ($this->getMiddlename()) { @@ -150,7 +150,7 @@ public function getName() } $name .= ' ' . $this->getLastname(); if ($this->getSuffix()) { - $name .= ' ' . $this->getSuffix(); + $name .= ' ' . __($this->getSuffix()); } return $name; }