/** * {@inheritdoc} */ public function getAvailableLocales() { $currentChannel = $this->channelContext->getChannel(); return $currentChannel->getLocales()->filter(function (LocaleInterface $locale) { return $locale->isEnabled(); })->toArray(); }
/** * @return string[] */ protected function getEnabledLocalesCodes() { $localesCodes = array(); /** @var LocaleInterface[] $locales */ $locales = $this->channelContext->getChannel()->getLocales(); foreach ($locales as $locale) { if (!$locale->isEnabled()) { continue; } $localesCodes[] = $locale->getCode(); } return $localesCodes; }