57 $this->_storeGroupFactory = $storeGroupFactory;
58 $this->_storeFactory = $storeFactory;
59 parent::__construct($context,
$data);
69 $this->setLanguages([]);
70 return parent::_construct();
76 protected function _loadData()
82 $websiteId = $this->_storeManager->getStore()->getWebsiteId();
83 $storeCollection = $this->_storeFactory->create()->getCollection()->addWebsiteFilter(
$websiteId);
84 $groupCollection = $this->_storeGroupFactory->create()->getCollection()->addWebsiteFilter(
$websiteId);
85 foreach ($groupCollection as
$group) {
89 foreach ($storeCollection as
$store) {
93 $store->setLocaleCode($this->_scopeConfig->getValue(
95 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
101 $this->_loaded =
true;
112 $localeCode = $this->_scopeConfig->getValue(
116 foreach ($this->_groups as
$group) {
117 if (!isset($this->_stores[
$group->getId()])) {
122 if (
$store->getLocaleCode() == $localeCode) {
127 if (!$useStore && isset($this->_stores[
$group->getId()][
$group->getDefaultStoreId()])) {
133 return count($this->getStores());
141 $groupId = $this->_storeManager->getStore()->getGroupId();
142 if (!isset($this->_stores[
$groupId])) {
143 $this->setLanguages([]);
146 $this->setLanguages($this->_stores[
$groupId]);
147 return count($this->getLanguages());
155 return $this->_storeManager->getStore()->getId();
163 return $this->_storeManager->getStore()->getCode();
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Store\Model\GroupFactory $storeGroupFactory, \Magento\Store\Model\StoreFactory $storeFactory, array $data=[])
const XML_PATH_DEFAULT_LOCALE