Returns all domains for each locale.

@return array
427528
public function getAllByLocaleAndDomain($locale, $domain)
    {
        return $this->createQueryBuilder('tu')
            ->select('tu, te')
            ->leftJoin('tu.translations', 'te')
            ->where('tu.domain = :domain')
            ->andWhere('te.locale = :locale')
            ->setParameter('domain', $domain)
            ->setParameter('locale', $locale)
            ->getQuery()
            ->getArrayResult();
    }
725053
public function getActiveLocales()
	{
		$activeLocales = array();
		
		$locales = $this->getLocales();

		foreach ($locales as $id => $locale) {
			if ($locale->isActive()) {
				$activeLocales[$id] = $locale;
			}
		}

		return $activeLocales;
	}
754100
public function findForLocalesAndDomains(array $locales, array $domains)
    {
        $builder = $this->createQueryBuilder('f');

        if (count($locales) > 0) {
            $builder->andWhere($builder->expr()->in('f.locale', $locales));
        }

        if (count($domains) > 0) {
            $builder->andWhere($builder->expr()->in('f.domain', $domains));
        }

        return $builder->getQuery()->getResult();
    }
1193857
public function availableLanguages()
    {
        $languages = array();
        $languageObjects = $this->languages();

        foreach ( $languageObjects as $languageObject )
        {
            $languages[] = $languageObject->attribute( 'locale' );
        }

        return $languages;
    }
232078
public function keys()
    {
        $locales = array_map(function (LocaleCollection $locales) {
            $keys = $locales->keys()->toArray();
            return array_combine($keys, $keys);
        }, $this->locales);

        $all = [];

        foreach ($locales as $keys) {
            $all = array_merge($all, $keys);
        }

        return $all;
    }
1162292
protected function getDomains() {
        if (!$this->_domains) {
            $this->_domains = new DomainList($this->version, $this->solution['accountSid']);
        }

        return $this->_domains;
    }
512671
public function getAllLocalizations()
    {
        $localizations = [];
        if (null !== $this->getChildren() && count($this->getChildren()) > 0) {
            foreach ($this->getChildren() as $child) {
                $localizations[] = $child;
                $localizations = array_merge($localizations, $child->getAllLocalizations());
            }
        }

        return $localizations;
    }
128252
public function getCatalogs($locale = null, $domain = null) {
		$cache = $this->getCacheFrontend();
		
		if (is_array($locale)) {
			$catalogs = $cache->getMany($locale);
			
			return empty($catalogs) ? null : $catalogs;
		}
		
		$catalogs = $cache->get($locale);
		
		if ($catalogs === null) {
			return;
		}
		
		return [$locale => $catalogs];
	}
997468
public static function allNames()
    {
        static $list;

        if ($list === null) {
            $list = [];
            $data = \ResourceBundle::create(\Locale::getDefault(), 'ICUDATA-curr')->get('Currencies');
            foreach ($data as $code => $values) {
                $list[$code] = $values[1];
            }
        }

        return $list;
    }
895256
public function fetchAll()
    {
        if (static::$languages === null) {
            static::$languages = $this->driver()->fetchAll();

            static::$languages = array_map(function ($language) {
                return new Locale($language);
            }, static::$languages);
        }

        return static::$languages;
    }
892133
protected function _getDomains($str)
    {
        $domains = array();
        $str = trim($str);
        if (strlen($str)) {
            $str = array_map('trim', preg_split("%[^a-z\-\d\.]+%", strtolower($str)));
            foreach ($str as $domain) {
                if (strlen($domain)) {
                    $domains[] = $domain;
                }
            }
        }
        return $domains;
    }
72590
public function getKeys(
        array $domains = [],
        array $languages = []
    ) : array {
        return array_reduce(
            $this->getTranslations(
                $domains,
                $languages
            ),
            function (array $keys, Translation $translation) {
                $keys[] = $translation->getKey();

                return $keys;
            },
            []
        );
    }
625970
public function getAllTranslationByLanguage()
    {
        $messages = array();
        foreach ($this->getLanguageList() as $language) {
            $messages[$language] = $this->getTranslationsForLanguage($language);
        }

        return $messages;
    }
1227969
public function getTranslations(
        array $domains = [],
        array $languages = [],
        callable $filter = null
    ) : array {
        $translations = array_filter(
            $this->translations,
            function (Translation $translation) {
                return $translation->getValue() != '';
            }
        );

        if (is_callable($filter)) {
            $translations = array_filter(
                $translations,
                $filter
            );
        }

        return $translations;
    }
1083045
protected function getLocaleChoices()
    {
        $localeChoices = [];

        if (!$this->request) {
            return [];
        }

        if (!$this->getRequest()->get('locale')) {
            $locale = $this->getRequest()->getLocale();
        } else {
            $locale = $this->getRequest()->get('locale');
        }

        if (is_array($locale) && array_key_exists('value', $locale)) {
            $locale = $locale['value'];
        }

        $localeList = Intl::getLocaleBundle()->getLocaleNames(substr($locale, 0, 2));

        foreach ($this->languages as $language) {
            $localeChoices[$localeList[$language['locale']]] = $language['locale'];
        }

        return $localeChoices;
    }
996414
public function getSupportedLocales()
    {
        $return = [];
        $process = new Process(['locale', '-a']);
        $process->run();
        $installedLocales = explode(PHP_EOL, trim($process->getOutput()));
        foreach ($this->supportedLocales as $supportedLocale) {
            if (in_array($supportedLocale, $installedLocales)
                || in_array($supportedLocale.'.utf8', $installedLocales)
            ) {
                $return[] = new Locale($supportedLocale);
            }
        }

        return $return;
    }
283613
public function getAllDomainsByLocale()
    {
        $reduce = <<<FCT
function (obj, prev) {
    if (typeof(prev.couples) == 'undefined') { prev.couples = new Array(); }

    if (typeof(obj.translations) != 'undefined') {
        obj.translations.forEach(function (translation) {
            var i = 0, found = false;
            while (i<prev.couples.length && !found) {
                found = (prev.couples[i].locale == translation['locale'] && prev.couples[i].domain == obj.domain);
                i++;
            }
            if (!found) { prev.couples.push({"locale": translation['locale'], "domain": obj.domain}); }
        });
    }
}
FCT;

        $results = $this->createQueryBuilder()
            ->hydrate(false)
            ->group(array(), array('couples' => array()))
            ->reduce($reduce)
            ->sort(array('translations.locale' => 'asc', 'domain' => 'asc'))
            ->getQuery()
            ->execute();

        $couples = array();

        if (isset($results[0], $results[0]['couples'])) {
            $couples = $results[0]['couples'];

            usort($couples, function ($a, $b) {
                $result = strcmp($a['locale'], $b['locale']);
                if (0 === $result) {
                    $result = strcmp($a['domain'], $b['domain']);
                }
                return $result;
            });
        }

        return $couples;
    }