public function build()
    {
        $fixer = new VendorDirectoryFixer();
        // Set up the Translation component
        $translator = new Translator($this->locale);
        $pos        = strpos($this->locale, '_');
        $file       = 'validators.' . ($pos ? substr($this->locale, 0, $pos) : $this->locale) . '.xlf';
        $translator->addLoader('xlf', new XliffFileLoader());
        $translator->addResource(
            'xlf',
            $fixer->getLocation('form', self::FORM_TRANSLATIONS_DIR . $file),
            $this->locale,
            self::TRANSLATION_DOMAIN
        );
        $translator->addResource(
            'xlf',
            $fixer->getLocation('validator', self::VALIDATOR_TRANSLATIONS_DIR . $file),
            $this->locale,
            self::TRANSLATION_DOMAIN
        );
        return $translator;
    }
public function build()
    {
        $fixer = new VendorDirectoryFixer();
        // Set up the Translation component
        $translator = new Translator($this->locale);
        $pos        = strpos($this->locale, '_');
        $file       = 'validators.' . ($pos ? substr($this->locale, 0, $pos) : $this->locale) . '.xlf';
        $translator->addLoader('xlf', new XliffFileLoader());
        $translator->addResource(
            'xlf',
            $fixer->getLocation('form', self::FORM_TRANSLATIONS_DIR . $file),
            $this->locale,
            self::TRANSLATION_DOMAIN
        );
        $translator->addResource(
            'xlf',
            $fixer->getLocation('validator', self::VALIDATOR_TRANSLATIONS_DIR . $file),
            $this->locale,
            self::TRANSLATION_DOMAIN
        );
        return $translator;
    }
public function build ( ) { $ fixer = new VendorDirectoryFixer ( ) ; // Set up the Translation component $ translator = new Translator ( $ this -> locale ) ; $ pos = strpos ( $ this -> locale , '_' ) ; $ file = 'validators.' . ( $ pos ? substr ( $ this -> locale , 0 , $ pos ) : $ this -> locale ) . '.xlf' ; $ translator -> addLoader ( 'xlf' , new XliffFileLoader ( ) ) ; $ translator -> addResource ( 'xlf' , $ fixer -> getLocation ( 'form' , self :: FORM_TRANSLATIONS_DIR . $ file ) , $ this -> locale , self :: TRANSLATION_DOMAIN ) ; $ translator -> addResource ( 'xlf' , $ fixer -> getLocation ( 'validator' , self :: VALIDATOR_TRANSLATIONS_DIR . $ file ) , $ this -> locale , self :: TRANSLATION_DOMAIN ) ; return $ translator ; }
Builds a translator
@return \Symfony\Component\Translation\TranslatorInterface
Builds a translator