Command/ExportTranslationsCommand.php
protected function mergeExistingTranslations($file, $outputFile, $translations)
    {
        if (file_exists($outputFile)) {
            $extension = pathinfo($outputFile, PATHINFO_EXTENSION);
            $loader = $this->getContainer()->get('lexik_translation.translator')->getLoader($extension);
            $messageCatalogue = $loader->load($outputFile, $file->getLocale(), $file->getDomain());

            $translations = array_merge($messageCatalogue->all($file->getDomain()), $translations);
        }

        return $translations;
    }
protected function mergeExistingTranslations($file, $outputFile, $translations)
    {
        if (file_exists($outputFile)) {
            $extension = pathinfo($outputFile, PATHINFO_EXTENSION);
            $loader = $this->getContainer()->get('lexik_translation.translator')->getLoader($extension);
            $messageCatalogue = $loader->load($outputFile, $file->getLocale(), $file->getDomain());

            $translations = array_merge($messageCatalogue->all($file->getDomain()), $translations);
        }

        return $translations;
    }
protected function mergeExistingTranslations ( $ file , $ outputFile , $ translations ) { if ( file_exists ( $ outputFile ) ) { $ extension = pathinfo ( $ outputFile , PATHINFO_EXTENSION ) ; $ loader = $ this -> getContainer ( ) -> get ( 'lexik_translation.translator' ) -> getLoader ( $ extension ) ; $ messageCatalogue = $ loader -> load ( $ outputFile , $ file -> getLocale ( ) , $ file -> getDomain ( ) ) ; $ translations = array_merge ( $ messageCatalogue -> all ( $ file -> getDomain ( ) ) , $ translations ) ; } return $ translations ; }
If the output file exists we merge existing translations with those from the database.

@param FileInterface $file
@param string $outputFile
@param array $translations
@return array
If the output file exists we merge existing translations with those from the database .