10 use Magento\Translation\Model\ResourceModel\TranslateFactory;
23 private $translateFactory;
28 private $storeManager;
38 private $deploymentConfig;
46 TranslateFactory $translateFactory,
50 $this->translateFactory = $translateFactory;
61 public function get(
$path =
'')
63 if (!$this->deploymentConfig->isDbAvailable()) {
69 $translate = $this->translateFactory->create();
70 $select = $translate->getConnection()->select()
71 ->from($translate->getMainTable(), [
'string',
'translate',
'store_id',
'locale'])
74 foreach ($translate->getConnection()->fetchAll(
$select) as
$item) {
75 $store = $this->storeManager->getStore(
$item[
'store_id']);
78 $this->data =
new DataObject($translations);
80 return $this->data->getData(
$path) ?: [];
__construct(TranslateFactory $translateFactory, StoreManager $storeManager, DeploymentConfig $deploymentConfig)