Can you tell me how to do the same thing on Magento 2?

Mage::getSingleton('core/translate')->init('frontend', true);
  • what you actually want to do?
    – ASQ
    Aug 9, 2019 at 10:05
  • I see this line of code in a module magento 1 that i want to replicate on magento 2. I wanted to study it well on magento 2
    – Mastafis
    Aug 9, 2019 at 10:47

1 Answer 1


I think there is no need to do this programmatically. Magento 2 Admin provides an option to enable or disable inline translation. Below image will help you to do this.

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.