Skip to content

Commit 662d548

Browse files
committed
just download and put new messages
1 parent 0108efb commit 662d548

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Service/PhraseApp.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader;
1515
use Symfony\Component\Finder\Finder;
1616
use Symfony\Component\Finder\SplFileInfo;
17-
use Symfony\Component\Translation\Catalogue\DiffOperation;
1817
use Symfony\Component\Translation\MessageCatalogue;
1918
use Symfony\Component\Translation\Writer\TranslationWriter;
2019

@@ -176,22 +175,15 @@ protected function dumpMessages($targetLocale)
176175
$extractedCatalogue = new MessageCatalogue($targetLocale);
177176
$this->translationLoader->loadMessages($this->getTmpPath(), $extractedCatalogue);
178177

179-
// load any existing messages from the translation files
180-
$this->logger->notice('Loading existing catalogues from "{translationsPath}"', ['translationsPath' => $this->translationsPath]);
181-
$currentCatalogue = new MessageCatalogue($targetLocale);
182-
$this->translationLoader->loadMessages($this->translationsPath, $currentCatalogue);
183-
184-
$operation = new DiffOperation($extractedCatalogue, $currentCatalogue);
185-
186178
// Exit if no messages found.
187-
if (0 === count($operation->getDomains())) {
179+
if (0 === count($extractedCatalogue->getDomains())) {
188180
$this->logger->warning('No translation found for locale {locale}', ['locale' => $targetLocale]);
189181

190182
return;
191183
}
192184

193185
$this->logger->notice('Writing translation file for locale "{locale}".', ['locale' => $targetLocale]);
194-
$this->translationWriter->writeTranslations($operation->getResult(), $this->outputFormat, ['path' => $this->translationsPath]);
186+
$this->translationWriter->writeTranslations($extractedCatalogue, $this->outputFormat, ['path' => $this->translationsPath]);
195187
}
196188

197189
/**

0 commit comments

Comments
 (0)