SymfonyComponentTranslationDumperJsonFileDumper

JsonFileDumper generates an json formatted string representation of a message catalogue.

Defined (1)

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

/vendor/symfony/translation/Dumper/JsonFileDumper.php  
  1. class JsonFileDumper extends FileDumper 
  2. /** 
  3. * {@inheritdoc} 
  4. */ 
  5. public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) 
  6. if (isset($options['json_encoding'])) { 
  7. $flags = $options['json_encoding']; 
  8. } else { 
  9. $flags = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0; 
  10.  
  11. return json_encode($messages->all($domain), $flags); 
  12.  
  13. /** 
  14. * {@inheritdoc} 
  15. */ 
  16. protected function getExtension() 
  17. return 'json';