Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public function renderArray($addressAttributes, $format = null)
$data[$key] = $v;
}
}
if (in_array($attributeCode, ['prefix', 'suffix']))
$value = __($value);
$data[$attributeCode] = $value;
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Customer/Helper/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Customer/Model/Address/AbstractAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Customer/Model/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Sales/Model/Order/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ public function getName()
{
$name = '';
if ($this->getPrefix()) {
$name .= $this->getPrefix() . ' ';
$name .= __($this->getPrefix()) . ' ';
}
$name .= $this->getFirstname();
if ($this->getMiddlename()) {
$name .= ' ' . $this->getMiddlename();
}
$name .= ' ' . $this->getLastname();
if ($this->getSuffix()) {
$name .= ' ' . $this->getSuffix();
$name .= ' ' . __($this->getSuffix());
}
return $name;
}
Expand Down