1

[![enter image description here][1]][1]

Which file i can change .xml or .phtml file Sign in to Log in

where the location of files....

3 Answers 3

6

The simple way is to add default text with your text into app/design/frontend/Custom/default/i18n/en_US.csv

like

"Sign In","Login"

clear cache after that

php bin/magento cache:clean && php bin/magento cache:flush
12
  • i added to layout folder but not changing... Commented Nov 23, 2018 at 10:27
  • you don't need to do anything with layout folder, create en_US.csv into i18n folder if not there in your custom theme
    – Hitesh
    Commented Nov 23, 2018 at 10:29
  • i18n floder not in my custom theme Commented Nov 23, 2018 at 10:32
  • Ok then you should create there
    – Hitesh
    Commented Nov 23, 2018 at 10:33
  • it's working how..... Commented Nov 23, 2018 at 10:46
2

You need to change getLabel() function in \Magento\Customer\Block\Account\AuthorizationLink

  1. Create the di.xml file in your custom module. Add the following :

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Customer\Block\Account\AuthorizationLink" type="Custom\Module\Block\Account\AuthorizationLink" /> </config>

  1. Create AuthorizationLink.php under Custom\Module\Block\Account\ and add the following :

<?php namespace Custom\Module\Block\Account; class AuthorizationLink extends \Magento\Customer\Block\Account\AuthorizationLink { public function getLabel() { return $this->isLoggedIn() ? __('Sign Out') : __('Log In'); } }

Run setup upgrade command and check the result. It's done.

6
  • \Magento\Customer\Block\Account\AuthorizationLink this path not in my app\design Commented Nov 23, 2018 at 10:35
  • It will not be in app/design. Start doing from point 1. Commented Nov 23, 2018 at 10:59
  • That problem is solved ... How i can add Text in header Commented Nov 23, 2018 at 11:01
  • By point number 2. Commented Nov 23, 2018 at 11:02
  • pub/static or vendor folder Commented Nov 23, 2018 at 11:04
1

If you want to change the 'create account' label with XML the code you have to paste

Go to app/design/frontend/vendor/module/Magento_Theme/layout/default.xml

and place below code

<referenceBlock name="register-link">
        <arguments>
            <argument name="label" xsi:type="string" translate="true">Resiter Account</argument>
        </arguments>
    </referenceBlock>

enter image description here

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.