Retrieve all translations for the provided ids (within the provided locale and domain)

@param string $locale
@param string $domain
@param array $ids
@return array
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;
    }
168309
public function getTranslations(
        array $domains = [],
        array $languages = [],
        callable $filter = null
    ) : array {
        return $this
            ->translationCollection
            ->getTranslations(
                $domains,
                $languages,
                $filter
            );
    }
1314511
public function trans($id, array $parameters = [], $domain = null, $locale = null)
    {
        $domain = $domain ?? $this->config->getDefaultDomain();
        $locale = $locale ?? $this->locale;

        $message = $this->get($locale, $domain, $id);

        return self::interpolate($message, $parameters);
    }
514714
public function getAll( $domain )
	{
		$messages = [];

		foreach( $this->getTranslations( $domain ) as $object ) {
			$messages = $messages + $object->all();
		}

		return $messages;
	}
695960
public function getTranslationMessages($locale = 'en_EN', $textDomain = 'default')
    {
        // Get the translation service, so we would be able to fetch the current configs
        $translator = $this->getServiceLocator()->get('translator');
        $translation = $translator->getTranslator();
        $messages = array();

        // process to access the private properties of translation service
        $reflector = new \ReflectionObject($translation);
        $property = $reflector->getProperty('files');
        $property->setAccessible(true);
        $files = (array)$property->getValue($translation);

        if($files) {
            // re-add translation file to a new Translation Class Object
            if(isset($files['default']['*'])) {
                foreach($files['default']['*'] as $transKey => $transValues)
                {
                    $this->addTranslationFile('phparray', $transValues['filename'], 'default', $locale);
                }

                // Load Translation Messages
                if (!isset($this->messages[$textDomain][$locale])) {
                    $this->loadMessages($textDomain, $locale);
                }

                // This is where the translated mesage are stored
                $translatedMessages =  (array)$this->messages[$textDomain][$locale];


                $messages = array();
                $key = '';
                foreach($translatedMessages as $translationKey => $translationValues) {
                    $key =  str_replace("'", "\'", $translationKey);
                    $messages[$key] = str_replace("'", "\'", $translationValues);
                }
            }

        }



        return $messages;

    }
160842
protected function parseTrans($id, array $parameters = [], $domain = "flashes") {
        $text = $id;
        $separator = "::";
        $subSeparator = ";;";

        $textExplode = explode($separator, $id);
        if (is_array($textExplode)) {
            //id a traducir
            if (isset($textExplode[0])) {
                $text = $textExplode[0];
            }
            //Parametros de la traduccion
            if (isset($textExplode[1])) {
                $paramsString = $textExplode[1];
//                var_dump($paramsString);
                $parametersParsed = json_decode($paramsString, true);
                if (is_array($parametersParsed)) {
                    $this->parseScenarioParameters($parametersParsed);
                    foreach ($parametersParsed as $x => $v) {
                        if (strpos($v, $subSeparator) !== false) {
                            $v = str_replace($subSeparator, $separator, $v);
                            $parametersParsed[$x] = $this->parseTrans($v);
                        }
                    }
//                    var_dump($parametersParsed);
                    $parameters = $parametersParsed;
                }
            }
            //Dominio e la traduccion
            if (isset($textExplode[2])) {
                $domain = $textExplode[2];
            }
        }
        if (strpos($text, "|") && isset($parameters["{{ limit }}"])) {
            $trans = $this->container->get('translator')->transChoice($text, (int) $parameters["{{ limit }}"], $parameters, $domain);
        } else {
            $trans = $this->trans($text, $parameters, $domain);
        }
        return $trans;
    }
2602
public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
    {
        if ($this->translator instanceof TranslatorInterface) {
            $trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
        }

        $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);

        $this->collectMessage($locale, $domain, $id, $trans, ['%count%' => $number] + $parameters);

        return $trans;
    }
1369451
protected function translateTitle($id, array $parameters = array(), $domain = null)
    {
        return $this->translator->trans($id, $parameters, $domain);
    }
979343
public function getRepositories(
        array $domains = [],
        array $languages = []
    ) : array {
        $repositories = array_filter(
            $this->repositories,
            function (Repository $repository) use ($domains) {
                return
                    empty($domains) ||
                    in_array($repository->getDomain(), $domains);
            }
        );

        return array_filter(
            $repositories,
            function (Repository $repository) use ($languages) {
                return
                    empty($languages) ||
                    in_array($repository->getLanguage(), $languages);
            }
        );
    }
157193
public function findForLocalesAndDomains(array $locales, array $domains)
    {
        $builder = $this->createQueryBuilder();

        if (count($locales) > 0) {
            $builder->field('locale')->in($locales);
        }

        if (count($domains) > 0) {
            $builder->field('domain')->in($domains);
        }

        $cursor = $builder->getQuery()->execute();

        $files = array();
        foreach ($cursor as $result) {
            $files[] = $result;
        }

        return $files;
    }
401271
public function getAllByLocaleAndDomain($locale, $domain)
    {
        $unitsData = TransUnitQuery::create()
            ->filterByDomain($domain)
            ->joinWith('Translation')
            ->useTranslationQuery()
                ->filterByLocale($locale)
            ->endUse()
            ->setFormatter(ModelCriteria::FORMAT_ARRAY)
            ->find($this->getConnection())
        ;

        return $this->filterTransUnitData($unitsData);
    }
732855
public function trans($id, array $parameters = [], $domain = null, $locale = null)
    {
        if (null === $locale) {
            $locale = $this->getLocale();
        }

        if (null === $domain) {
            $domain = 'messages';
        }

        if (!isset($this->catalogues[$locale])) {
            $this->loadCatalogue($locale);
        }

        // Change translation domain to 'messages' if a translation can't be found in the
        // current domain
        if ('messages' !== $domain && false === $this->catalogues[$locale]->has((string) $id, $domain)) {
            $domain = 'messages';
        }

        return strtr($this->catalogues[$locale]->get((string) $id, $domain), $parameters);
    }
988172
protected function getSingleCatalog($locale, $domain = null) {
		if (! isset($this->catalogs[$locale])) {
				 return [];
		}

		if ($domain === null) {
			return [$locale => $this->catalogs[$locale]];
		}

		if (is_string($domain)) {
			if (! isset($this->catalogs[$locale][$domain])) {
				return [];
			}

			return [
				$locale => [
					$domain => $this->catalogs[$locale][$domain]
				]
			];
		}

		if (is_array($domain)) {
			return [$locale => array_intersect_key(
				$this->catalogs[$locale],
				array_flip($domain))
			];
		}
		
		throw new InvalidParameter('Domain must be a string or an array');
	}
808979
private function getTranslationFilesFromConfiguration($domain, $locale)
    {
        $filteredFilenames = array();

        foreach ($this->translationFilesByLocale as $localeFromConfig => $resourceFilePaths) {
            foreach ($resourceFilePaths as $filename) {
                list($currentDomain, $currentLocale) = explode('.', basename($filename), 3);

                if ($currentDomain === $domain && $currentLocale === $locale) {
                    $filteredFilenames[] = $filename;
                }
            }
        }
        return $filteredFilenames;
    }
1142178
public function trans(
        $id,
        array $parameters = array(),
        $domain = 'core',
        $locale = null,
        $return_default_if_not_available = true,
        $useFallback = true
    ) {
        if (null === $locale) {
            $locale = $this->getLocale();
        }

        if (!isset($this->catalogues[$locale])) {
            $this->loadCatalogue($locale);
        }

        // global translations
        if ($useFallback) {
            $fallbackId = sprintf(self::GLOBAL_FALLBACK_KEY, $domain, (string) $id);

            if ($this->catalogues[$locale]->has($fallbackId, self::GLOBAL_FALLBACK_DOMAIN)) {
                return parent::trans($fallbackId, $parameters, self::GLOBAL_FALLBACK_DOMAIN, $locale);
            }

            if ($this->catalogues[$locale]->has($id, self::GLOBAL_FALLBACK_DOMAIN)) {
                // global translations
                return parent::trans($id, $parameters, self::GLOBAL_FALLBACK_DOMAIN, $locale);
            }
        }

        if ($this->catalogues[$locale]->has((string) $id, $domain)) {
            return parent::trans($id, $parameters, $domain, $locale);
        } else {
            if ($return_default_if_not_available) {
                return strtr($id, $parameters);
            } else {
                return '';
            }
        }
    }
288874
public function getCatalogs($locale = null, $domain = null) {
		$cache = $this->getCacheFrontend();
		
		if (is_array($domain)) {
			$catalogs = $cache->getMany($domain);
			
			if (empty($catalogs)) {
				return;
			}
			
			return call_user_func_array('array_replace_recursive', $catalogs);
		}
		
		return $cache->get($domain);
	}
1358820
protected function importComponentTranslationFiles(array $locales, array $domains)
    {
        $classes = array(
            'Symfony\Component\Validator\Validation'                            => '/Resources/translations',
            'Symfony\Component\Form\Form'                                       => '/Resources/translations',
            'Symfony\Component\Security\Core\Exception\AuthenticationException' => '/../Resources/translations',
        );

        $dirs = array();
        foreach ($classes as $namespace => $translationDir) {
            $reflection = new \ReflectionClass($namespace);
            $dirs[] = dirname($reflection->getFilename()) . $translationDir;
        }

        $finder = new Finder();
        $finder->files()
            ->name($this->getFileNamePattern($locales, $domains))
            ->in($dirs);

        $this->importTranslationFiles($finder->count() > 0 ? $finder : null);
    }