|
14 | 14 | use Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader;
|
15 | 15 | use Symfony\Component\Finder\Finder;
|
16 | 16 | use Symfony\Component\Finder\SplFileInfo;
|
17 |
| -use Symfony\Component\Translation\Catalogue\DiffOperation; |
18 | 17 | use Symfony\Component\Translation\MessageCatalogue;
|
19 | 18 | use Symfony\Component\Translation\Writer\TranslationWriter;
|
20 | 19 |
|
@@ -176,22 +175,15 @@ protected function dumpMessages($targetLocale)
|
176 | 175 | $extractedCatalogue = new MessageCatalogue($targetLocale);
|
177 | 176 | $this->translationLoader->loadMessages($this->getTmpPath(), $extractedCatalogue);
|
178 | 177 |
|
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 |
| - |
186 | 178 | // Exit if no messages found.
|
187 |
| - if (0 === count($operation->getDomains())) { |
| 179 | + if (0 === count($extractedCatalogue->getDomains())) { |
188 | 180 | $this->logger->warning('No translation found for locale {locale}', ['locale' => $targetLocale]);
|
189 | 181 |
|
190 | 182 | return;
|
191 | 183 | }
|
192 | 184 |
|
193 | 185 | $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]); |
195 | 187 | }
|
196 | 188 |
|
197 | 189 | /**
|
|
0 commit comments