Command/ImportTranslationsCommand.php
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);
    }
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);
    }
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 ) ; }
Imports Symfony's components translation files.

@param array $locales
@param array $domains
Imports Symfony s components translation files .