This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Esun\MultiLocaleTranslation\Controller\Adminhtml\Translation;
use Esun\MultiLocaleTranslation\Model\StoreViewProvider;
use Esun\MultiLocaleTranslation\Model\ProviderConfig;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\Result\JsonFactory;
class Stores extends Action
{
public const ADMIN_RESOURCE = 'Esun_MultiLocaleTranslation::translation';
public function __construct(
Context $context,
private readonly JsonFactory $jsonFactory,
private readonly StoreViewProvider $storeViewProvider,
private readonly ProviderConfig $providerConfig
) {
parent::__construct($context);
}
public function execute(): Json
{
return $this->jsonFactory->create()->setData([
'success' => true,
'stores' => $this->storeViewProvider->getStoreViewOptions(),
'providers' => $this->providerConfig->getEnabledOptions(),
'default_provider' => $this->providerConfig->getDefaultProvider(),
]);
}
}