How to rewrite below code to fix version 2.0

$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

//Dealing with uninitialized translator!
Mage::app()->getTranslator()->init('frontend', true);

Thank you.

  • Please create object in your controller for \Magento\Framework\TranslateInterface & access it. File path magento\vendor\magento\framework\TranslateInterface.php – Jackson Dec 12 '16 at 2:43
 /* * @var \Magento\Store\Model\App\Emulation $_appEmulation **/


Take a look more detail: vendor/magento/module-store/Model/App/Emulation.php

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.