Exemple #1
0
 /**
  * Restore locale of the initial store
  *
  * @param string $initialLocaleCode
  * @param string $initialArea
  * @return $this
  */
 protected function _restoreInitialLocale($initialLocaleCode, $initialArea = \Magento\Framework\App\Area::AREA_ADMIN)
 {
     $this->_localeResolver->setLocale($initialLocaleCode);
     $this->_translate->setLocale($initialLocaleCode);
     $this->_translate->loadData($initialArea);
     return $this;
 }
Exemple #2
0
 /**
  * Initialize translate object.
  *
  * @return $this
  */
 protected function _initTranslate()
 {
     $this->_translator->loadData(null, false);
     \Magento\Framework\Phrase::setRenderer($this->_objectManager->get('Magento\\Framework\\Phrase\\RendererInterface'));
     return $this;
 }