From 662d5480d6dc2d59a7f57d864f760ad2b98221c4 Mon Sep 17 00:00:00 2001 From: nediam Date: Thu, 24 Sep 2015 14:39:14 +0200 Subject: [PATCH] just download and put new messages --- Service/PhraseApp.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Service/PhraseApp.php b/Service/PhraseApp.php index 454cf3f..39722e7 100644 --- a/Service/PhraseApp.php +++ b/Service/PhraseApp.php @@ -14,7 +14,6 @@ use Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; -use Symfony\Component\Translation\Catalogue\DiffOperation; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\Writer\TranslationWriter; @@ -176,22 +175,15 @@ protected function dumpMessages($targetLocale) $extractedCatalogue = new MessageCatalogue($targetLocale); $this->translationLoader->loadMessages($this->getTmpPath(), $extractedCatalogue); - // load any existing messages from the translation files - $this->logger->notice('Loading existing catalogues from "{translationsPath}"', ['translationsPath' => $this->translationsPath]); - $currentCatalogue = new MessageCatalogue($targetLocale); - $this->translationLoader->loadMessages($this->translationsPath, $currentCatalogue); - - $operation = new DiffOperation($extractedCatalogue, $currentCatalogue); - // Exit if no messages found. - if (0 === count($operation->getDomains())) { + if (0 === count($extractedCatalogue->getDomains())) { $this->logger->warning('No translation found for locale {locale}', ['locale' => $targetLocale]); return; } $this->logger->notice('Writing translation file for locale "{locale}".', ['locale' => $targetLocale]); - $this->translationWriter->writeTranslations($operation->getResult(), $this->outputFormat, ['path' => $this->translationsPath]); + $this->translationWriter->writeTranslations($extractedCatalogue, $this->outputFormat, ['path' => $this->translationsPath]); } /**