2

I tried to find the page in backend from content -> Pages, but the contact us page is not there.

I also find some answers for Magento 1, that you have to edit this file and change the name from here

/app/design/frontend/tm_themes/theme_number/layout/local.xml 

But on Magento 2 I can't find this file.

4 Answers 4

1

Place this XML in your theme folder:

your_theme_root/Magento_Contact/layout/contact_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Your new contact page title</title>
    </head>
</page>

Don't forget clear cache. Message me if you will have any issues.

1
  • It's working this way! Oct 23, 2017 at 9:29
1

Both Magento1 and Magento2, "Contact Us" pages does not a CMS page.it is Manage from a Module.

If you want then you

You can should do below process:

Create {Your_LanagaugeCode}.csv at if not exits

magento2/app/design/frontend/{themevendorname}/{Themename}/i18n/

Then add below code at this csv file

"Contact Us", "YOur_repectWord"

Then do Cache flush and do the static content deploy.

Source:

http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/translate_practice.html

http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/xlate.html

1
  • It's not working, your method only translate the page title, but not the title from the tab on browser Oct 23, 2017 at 9:29
0

Exist some bugs with translate Title of Page :)

for translate, need add Phraze to translate/locale file.

in your theme - i18n/de_DE.csv add following - "Contact Us","Kontaktieren Sie uns"

and clear cache.

0

Any of these answers worked for me (using Magento 2.1). The title wasn't correctly translated and was just printed in raw English.

However, I've found this solution on another website and it worked fine.

Just add this piece of code in the page Block class you want to translate :

public function _prepareLayout()
{
    $this->pageConfig->getTitle()->set(__('Inventory'));
}

The i18n translation file has to be set. Here is an example for the French file "i18n/fr_FR.csv" :

"Inventory","Inventaire"

My source : https://github.com/magento/magento2/issues/5231#issuecomment-385248982

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.