Get an array of all non disabled translations

@param string $locale
@param string $domain

@return array
344787
public function findAllNotDisabled($locale, $domain = null)
    {
        $qb = $this->createQueryBuilder('t');
        $qb
            ->select('t')
            ->where('t.locale = :locale')
            ->andWhere('t.status != :statusstring')
            ->setParameter('statusstring', Translation::STATUS_DISABLED)
            ->setParameter('locale', $locale);
        if (!\is_null($domain) && !empty($domain)) {
            $qb->andWhere('t.domain = :tdomain')
                ->setParameter('tdomain', $domain);
        }

        return $qb->getQuery()->getResult();
    }
807374
private function getTranslationsForDomain($locale, $domain)
    {
        $allMessages = $this->getTranslationsForLocale($locale);

        if (!array_key_exists($domain, $allMessages)) {
            throw new \Exception('Domain ' . $domain . ' not found in the translations for locale ' . $locale);
        }

        return $allMessages[$domain];
    }
703239
protected function getTranslation($domain, $context, $original)
    {
        return isset($this->dictionary[$domain][$context][$original])
             ? $this->dictionary[$domain][$context][$original]
             : false;
    }
356862
public function getTranslations(
        array $domains = [],
        array $languages = [],
        callable $filter = null
    ) : array {
        return $this
            ->repositoryCollection
            ->getTranslations(
                $domains,
                $languages,
                $filter
            );
    }
369241
public function retrieve($domain)
	{
		$key = $this->key($domain);

		$messages = isset($this->messages[$key]) ? $this->messages[$key] : array();

		if (count($messages))
		{
			$this->clear($domain);
		}

		return $messages;
	}
1352709
public function getMessageCatalogues($locale, $domain)
    {
        $catalogue = new MessageCatalogue($locale);
        $units = $this->findByDomain($domain);
        $translations = array();
        foreach ($units as $unit) {
            if ($unit->hasTranslation($locale)) {
                $translations[$unit->getKey()] = $unit->getTranslation($locale)->getValue();
            }
        }

        $catalogue->add($translations, $domain);

        return $catalogue;
    }
1257251
protected function getDatabaseTranslations(LocaleInterface $locale)
    {
        $messages   = [];
        $collection = $this->repository->matching(new Criteria());
        
        $collection->map(function (DictionaryInterface $dictionary) use ($locale, &$messages) {
            $messages[$dictionary->getIdentifier()] = $dictionary->translate($locale->getCode())->getValue();
        });
        
        return $messages;
    }
365748
public function retrieveAllAsArray($locale)
    {
        $result = [];

        /** @var CustomerType $customerType */
        foreach ($this->retrieveAll($locale) as $customerType) {
            $result[] = [
                'id' => $customerType->getId(),
                'name' => $customerType->getName(),
            ];
        }

        return $result;
    }
4096
private function getTranslationsForDomainAndIds($locale, $domain, $ids)
    {
        /** @var Translator $translator */
        $translator = $this->container->get('translator');

        $translations = [];
        foreach ($ids as $id) {
            $translations[$id] = $translator->trans($id, [], $domain, $locale);
        }

        return $translations;
    }
612062
public function getTranslations(
        array $domains = [],
        array $languages = [],
        callable $filter = null
    ) : array {
        return array_reduce(
            $this->getRepositories(
                $domains,
                $languages
            ),
            function (array $translations, Repository $repository) use ($domains, $languages, $filter) {
                return array_merge(
                    $translations,
                    $repository->getTranslations(
                        $domains,
                        $languages,
                        $filter
                    )
                );
            },
            []
        );
    }
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;
    }
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();
    }
485772
protected function getTranslation($domain, $context, $original)
    {
        return $this->dictionary[$domain][$context][$original] ?? false;
    }
722132
public function removeTranslation($locale, $domain, $key)
    {
        $unit = $this->findByDomainAndKey($domain, $key);
        $unit->deleteTranslation($locale);
        $this->persist($unit);
    }
1160191
public function getCatalogs($locale = null, $domain = null) {
		$cache   = $this->getCacheFrontend();
		$cacheId = $this->prepareCacheId($locale, $domain);
		
		// Many
		if (is_array($cacheId)) {
			$catalogsRaw = $cache->getMany($cacheId);
			
			if (empty($catalogsRaw)) {
				return;
			}
			
			$catalogs = [];
			
			foreach ($catalogsRaw as $catalogId => $catalog) {
				list($localePart, $domainPart) = explode('_', $catalogId);
				
				if (! isset($catalogs[$localePart])) {
					$catalogs[$localePart] = [];
				}
				
				$catalogs[$localePart][$domainPart] = $catalog;
			}
			
			return $catalogs;
		}
		
		// One
		$catalog = $cache->get($cacheId);
				
		if ($catalog === null) {
			return;
		}

		return [
			$locale => [
				$domain => $catalog
			]
		];
	}
30224
protected function _getTranslations( $domain )
	{
		if( !isset( $this->_translations[$domain] ) )
		{
			if ( !isset( $this->_translationSources[$domain] ) )
			{
				$msg = sprintf( 'No translation directory for domain "%1$s" available', $domain );
				throw new MW_Translation_Exception( $msg );
			}

			// Reverse locations so the former gets not overwritten by the later
			$locations = array_reverse( $this->_getTranslationFileLocations( $this->_translationSources[$domain], $this->getLocale() ) );
			$options = $this->_options;

			foreach( $locations as $location )
			{
				$options['content'] = $location;
				$this->_translations[$domain][] = new Zend_Translate( $options );
			}
		}

		return ( isset( $this->_translations[$domain] ) ? $this->_translations[$domain] : array() );
	}
182862
public function getFileTranslationMessages(SplFileInfo $file, $domain)
    {
        $locale = explode('.', $file->getFilename())[1];

        if (!in_array($locale, $this->getLocales())) {
            return [];
        }

        $translations = [];

        try {
            $domainMessages = $this->parser->parse(file_get_contents($file->getPath().DIRECTORY_SEPARATOR.$file->getFilename()));
        } catch (ParseException $e) {
            throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $file->getPath()), 0, $e);
        }

        $path = substr(pathinfo($file->getPathname(), PATHINFO_DIRNAME), strlen(getcwd()) + 1);

        $domainMessages = $this->flatten($domainMessages);

        foreach ($domainMessages as $key => $content) {
            $translations[$domain][$key]['messages'][$locale] = $content;
            $translations[$domain][$key]['path'] = $path;
            $translations[$domain][$key]['format'] = $file->getExtension();
        }

        return $translations;
    }