25 private $storeManager;
30 private $themeProvider;
40 \
Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider
42 $this->scopeConfig = $scopeConfig;
44 $this->themeProvider = $themeProvider;
52 public function retrieveThemeLocalePairs()
54 $stores = $this->storeManager->getStores();
55 $localeThemeData = [];
60 $themeId = $this->scopeConfig->getValue(
65 $localeThemeData[] = [
66 'theme' => $this->themeProvider->getThemeById($themeId)->getCode(),
67 'locale' => $this->scopeConfig->getValue(
75 return $this->removeDuplicates($localeThemeData);
83 public function retrieveLocales()
85 $stores = $this->storeManager->getStores();
90 $locales[] = $this->scopeConfig->getValue(
97 return $this->removeDuplicates(
$locales);
106 private function removeDuplicates($arr)
109 for ($out = 0; $out < $len; $out++) {
110 $outVal = $arr[$out];
111 for ($in = $out + 1; $in < $len; $in++) {
113 if ($outVal === $inVal) {
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider)
const XML_PATH_DEFAULT_LOCALE