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.
/* * @var \Magento\Store\Model\App\Emulation $_appEmulation **/
$this->_appEmulation->startEnvironmentEmulation(
$storeId,
\Magento\Framework\App\Area::AREA_FRONTEND
);
Take a look more detail: vendor/magento/module-store/Model/App/Emulation.php
\Magento\Framework\TranslateInterface
& access it. File pathmagento\vendor\magento\framework\TranslateInterface.php