Closed
Description
The page.main.title block is translating the title. This can lead to unwanted results (like the product name being translated...)
Preconditions
- MG2.1 CE
- PHP7.0
Steps to reproduce
- Create a product with the name 'Save'
- Create a storeview that doesn't use english as locale (I'm using nl_NL as example)
- Go to the product detail page
Expected result
- The page title in page.main.title should be 'Save'
Actual result
- The page title in page.main.title is 'Opslaan' (dutch translation for save)
I traced this back to \Magento\Theme\Block\Html\Title.
Both the getPageTitle() and getPageHeading() function are wrapping the output in the magic translation function. Because of this the product name is being translated.
public function getPageTitle()
{
if (!empty($this->pageTitle)) {
return $this->pageTitle;
}
return __($this->pageConfig->getTitle()->getShort());
}
public function getPageHeading()
{
if (!empty($this->pageTitle)) {
return __($this->pageTitle);
}
return __($this->pageConfig->getTitle()->getShortHeading());
}
I'm pretty sure the translation here can be dropped all together because you can control the page titles from either the layout xml's or through the backend on storeview values.
Metadata
Metadata
Assignees
Labels
Distributed Contribution DayThe issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentIndicates that Pull Request has been created to fix issueThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release