1

I am trying like below to put Breadcrumb and translation in Contact page of Magento 2. But can't translate. I put translation file under /vendor/magento/module-contact/i18n/zh_Hant_TW.csv Is it not correct?


    <referenceBlock name="breadcrumbs">
                 <action method="addCrumb" translate="crumbInfo.title crumbInfo.label">
                     <argument name="crumbName" xsi:type="string">home</argument>
                     <argument name="crumbInfo" xsi:type="array">
                         <item name="title" xsi:type="string">Home</item>
                         <item name="label" xsi:type="string">Home</item>
                         <item name="link" xsi:type="string">/</item>
                     </argument>
                 </action>
                 <action method="addCrumb" translate="crumbInfo.title crumbInfo.label">
                     <argument name="crumbName" xsi:type="string">Contact Us</argument>
                     <argument name="crumbInfo" xsi:type="array">
                         <item name="title" xsi:type="string">Contact Us</item>
                         <item name="label" xsi:type="string">Contact Us</item>
                     </argument>
                 </action>
                 
    </referenceBlock>

1
  • plz try <item name="label" xsi:type="string" translate="true">Contact Us</item>
    – Pawan
    Jan 7, 2021 at 4:45

1 Answer 1

0

You need to add translate="true" if you want translation for it.

like:

<item name="label" xsi:type="string" translate="true">Contact Us</item>

For translation, you can refer Answer

Hope above will help!

2
  • Yes. Now it is working when put < translate="true" >. Thanks a lot for your support. <3
    – Nang
    Jan 7, 2021 at 7:09
  • welcome... @Nang
    – Pawan
    Jan 7, 2021 at 9:08

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.