I have created custom module in Magento2. I have created succesfuly added custom link in customer dashboard. But I want to change existing label of customer dashboard account. I have attached screenshot.
Please Give me any suggestions.
There are two ways to achieve this
Just go to below location
magento_root\app\design\frontend\ {Package}\ {theme}\Magento_Customer\layout
create an .xml
file there with name customer_account.xml
Put the below code there
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom">
<body>
<referenceBlock name="customer-account-navigation-orders-link">
<arguments>
<argument name="label" xsi:type="string">Orders</argument>
</arguments>
</referenceBlock>
</body>
</page>
To get the actual file with this settings you can have as a reference file available at the below location
magento_root\vendor\magento\module-customer\view\frontend\layout\customer_account.xml
en_US.csv
file.For this just create an en_US. csv file at the below location
magento_root\app\code\Package\Module\i18n
Put there below code in en_US.csv
file
"My Orders","Orders"
Revert back if facing any problem.
You can change your label if you create translation file in CSV format. In your module create a directory "i18n" and and your transalation.