SymfonyComponentTranslationExtractorChainExtractor

ChainExtractor extracts translation messages from template files.

Defined (1)

The class is defined in the following location(s).

/vendor/symfony/translation/Extractor/ChainExtractor.php  
  1. class ChainExtractor implements ExtractorInterface 
  2. /** 
  3. * The extractors. 
  4. * @var ExtractorInterface[] 
  5. */ 
  6. private $extractors = array(); 
  7.  
  8. /** 
  9. * Adds a loader to the translation extractor. 
  10. * @param string $format The format of the loader 
  11. * @param ExtractorInterface $extractor The loader 
  12. */ 
  13. public function addExtractor($format, ExtractorInterface $extractor) 
  14. $this->extractors[$format] = $extractor; 
  15.  
  16. /** 
  17. * {@inheritdoc} 
  18. */ 
  19. public function setPrefix($prefix) 
  20. foreach ($this->extractors as $extractor) { 
  21. $extractor->setPrefix($prefix); 
  22.  
  23. /** 
  24. * {@inheritdoc} 
  25. */ 
  26. public function extract($directory, MessageCatalogue $catalogue) 
  27. foreach ($this->extractors as $extractor) { 
  28. $extractor->extract($directory, $catalogue);