Manager/TransUnitManager.php
public function getTranslationFile(TransUnitInterface & $transUnit, $locale)
    {
        $file = null;
        foreach ($transUnit->getTranslations() as $translation) {
            if (null !== $file = $translation->getFile()) {
                break;
            }
        }

        //if we found a file
        if ($file !== null) {
            //make sure we got the correct file for this locale and domain
            $name = sprintf('%s.%s.%s', $file->getDomain(), $locale, $file->getExtention());
            $file = $this->fileManager->getFor($name, $this->kernelRootDir.DIRECTORY_SEPARATOR.$file->getPath());
        }

        return $file;
    }
public function getTranslationFile(TransUnitInterface & $transUnit, $locale)
    {
        $file = null;
        foreach ($transUnit->getTranslations() as $translation) {
            if (null !== $file = $translation->getFile()) {
                break;
            }
        }

        //if we found a file
        if ($file !== null) {
            //make sure we got the correct file for this locale and domain
            $name = sprintf('%s.%s.%s', $file->getDomain(), $locale, $file->getExtention());
            $file = $this->fileManager->getFor($name, $this->kernelRootDir.DIRECTORY_SEPARATOR.$file->getPath());
        }

        return $file;
    }
public function getTranslationFile ( TransUnitInterface & $ transUnit , $ locale ) { $ file = null ; foreach ( $ transUnit -> getTranslations ( ) as $ translation ) { if ( null !== $ file = $ translation -> getFile ( ) ) { break ; } } //if we found a file if ( $ file !== null ) { //make sure we got the correct file for this locale and domain $ name = sprintf ( '%s.%s.%s' , $ file -> getDomain ( ) , $ locale , $ file -> getExtention ( ) ) ; $ file = $ this -> fileManager -> getFor ( $ name , $ this -> kernelRootDir . DIRECTORY_SEPARATOR . $ file -> getPath ( ) ) ; } return $ file ; }
Get the proper File for this TransUnit and locale

@param TransUnitInterface $transUnit
@param string $locale

@return FileInterface|null
Get the proper File for this TransUnit and locale