src/Behat/Behat/Context/Reader/TranslatableContextReader.php
private function addTranslationResource($path, $assetsId)
    {
        switch ($ext = pathinfo($path, PATHINFO_EXTENSION)) {
            case 'yml':
                $this->addTranslatorResource('yaml', $path, basename($path, '.' . $ext), $assetsId);
                break;
            case 'xliff':
                $this->addTranslatorResource('xliff', $path, basename($path, '.' . $ext), $assetsId);
                break;
            case 'php':
                $this->addTranslatorResource('php', $path, basename($path, '.' . $ext), $assetsId);
                break;
            default:
                throw new UnknownTranslationResourceException(sprintf(
                    'Can not read translations from `%s`. File type is not supported.',
                    $path
                ), $path);
        }
    }
private function addTranslationResource($path, $assetsId)
    {
        switch ($ext = pathinfo($path, PATHINFO_EXTENSION)) {
            case 'yml':
                $this->addTranslatorResource('yaml', $path, basename($path, '.' . $ext), $assetsId);
                break;
            case 'xliff':
                $this->addTranslatorResource('xliff', $path, basename($path, '.' . $ext), $assetsId);
                break;
            case 'php':
                $this->addTranslatorResource('php', $path, basename($path, '.' . $ext), $assetsId);
                break;
            default:
                throw new UnknownTranslationResourceException(sprintf(
                    'Can not read translations from `%s`. File type is not supported.',
                    $path
                ), $path);
        }
    }
private function addTranslationResource ( $ path , $ assetsId ) { switch ( $ ext = pathinfo ( $ path , PATHINFO_EXTENSION ) ) { case 'yml' : $ this -> addTranslatorResource ( 'yaml' , $ path , basename ( $ path , '.' . $ ext ) , $ assetsId ) ; break ; case 'xliff' : $ this -> addTranslatorResource ( 'xliff' , $ path , basename ( $ path , '.' . $ ext ) , $ assetsId ) ; break ; case 'php' : $ this -> addTranslatorResource ( 'php' , $ path , basename ( $ path , '.' . $ ext ) , $ assetsId ) ; break ; default : throw new UnknownTranslationResourceException ( sprintf ( 'Can not read translations from `%s`. File type is not supported.' , $ path ) , $ path ) ; } }
Adds translation resource.

@param string $path
@param string $assetsId

@throws UnknownTranslationResourceException
Adds translation resource .