File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 14
14
use RuntimeException ;
15
15
use Symfony \Bundle \FrameworkBundle \Translation \TranslationLoader ;
16
16
use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
17
- use Symfony \Component \Finder \Finder ;
18
- use Symfony \Component \Finder \SplFileInfo ;
19
17
use Symfony \Component \Translation \MessageCatalogue ;
20
18
use Symfony \Component \Translation \Writer \TranslationWriter ;
21
19
@@ -305,13 +303,14 @@ protected function generateTmpPath()
305
303
306
304
protected function cleanUp ()
307
305
{
308
- $ finder = new Finder ();
309
- $ files = $ finder ->files ()->name ('*.*.yml ' )->in ($ this ->getTmpPath ());
310
- /** @var SplFileInfo $file */
311
- foreach ($ files as $ file ) {
312
- if (false === @unlink ($ file )) {
313
- $ this ->logger ->warning (strtr ('Could not delete the translation file "{file}". ' , ['{file} ' => $ file ]));
306
+ foreach ($ this ->downloadedLocales as $ locale => $ files ) {
307
+ foreach ($ files as $ file ) {
308
+ if (false === @unlink ($ file )) {
309
+ $ this ->logger ->warning (strtr ('Could not delete the translation file "{file}". ' , ['{file} ' => $ file ]));
310
+ }
314
311
}
312
+
313
+ unset($ this ->downloadedLocales [$ locale ]);
315
314
}
316
315
}
317
316
}
You can’t perform that action at this time.
0 commit comments