Command/ExportTranslationsCommand.php
protected function doExport($outputFile, $translations, $format)
    {
        $this->output->writeln(sprintf('<comment>Output file: %s</comment>', $outputFile));
        $this->output->write(sprintf('<comment>%d translations to export: </comment>', count($translations)));

        try {
            $exported = $this->getContainer()->get('lexik_translation.exporter_collector')->export(
                $format,
                $outputFile,
                $translations
            );

            $this->output->writeln($exported ? '<comment>success</comment>' : '<error>fail</error>');
        } catch (\Exception $e) {
            $this->output->writeln(sprintf('<error>"%s"</error>', $e->getMessage()));
        }
    }
protected function doExport($outputFile, $translations, $format)
    {
        $this->output->writeln(sprintf('<comment>Output file: %s</comment>', $outputFile));
        $this->output->write(sprintf('<comment>%d translations to export: </comment>', count($translations)));

        try {
            $exported = $this->getContainer()->get('lexik_translation.exporter_collector')->export(
                $format,
                $outputFile,
                $translations
            );

            $this->output->writeln($exported ? '<comment>success</comment>' : '<error>fail</error>');
        } catch (\Exception $e) {
            $this->output->writeln(sprintf('<error>"%s"</error>', $e->getMessage()));
        }
    }
protected function doExport ( $ outputFile , $ translations , $ format ) { $ this -> output -> writeln ( sprintf ( '<comment>Output file: %s</comment>' , $ outputFile ) ) ; $ this -> output -> write ( sprintf ( '<comment>%d translations to export: </comment>' , count ( $ translations ) ) ) ; try { $ exported = $ this -> getContainer ( ) -> get ( 'lexik_translation.exporter_collector' ) -> export ( $ format , $ outputFile , $ translations ) ; $ this -> output -> writeln ( $ exported ? '<comment>success</comment>' : '<error>fail</error>' ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( sprintf ( '<error>"%s"</error>' , $ e -> getMessage ( ) ) ) ; } }
Export translations.

@param string $outputFile
@param array $translations
@param string $format
Export translations .