I keep getting this error:

Invalid method Inchoo\SocialConnect\Block\Login::__


public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Inchoo\SocialConnect\Model\Google\Client $socialConnectGoogleClient,
        \Inchoo\SocialConnect\Model\Facebook\Client $socialConnectFacebookClient,
        \Inchoo\SocialConnect\Model\Twitter\Client $socialConnectTwitterClient,
        \Inchoo\SocialConnect\Model\Pixelpin\Client $socialConnectPixelpinClient,
        \Magento\Framework\Registry $registry,
        array $data = []
    ) {
        $this->socialConnectGoogleClient = $socialConnectGoogleClient;
        $this->socialConnectFacebookClient = $socialConnectFacebookClient;
        $this->socialConnectTwitterClient = $socialConnectTwitterClient;
        $this->socialConnectPixelpinClient = $socialConnectPixelpinClient;
        $this->registry = $registry;

I also put my module on github if you want to dig a bit further: https://github.com/CallumBrankin/Magento2-Inchoo-Social-Plugin


Replace in all the project the occurences of $this->__(....) with __('...').
So remove $this from the translation function.

  • so in login.phtml do i need to change every single "$this->_(....)" to " _('...')"?
    – Callum
    Nov 15 '16 at 12:05
  • i've changed all the "$this->_(....)" to " _('...')" in login.phtml and now it works
    – Callum
    Nov 15 '16 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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