[BUGFIX] Flush l10n cache after translation update 80/47780/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 19 Apr 2016 11:18:13 +0000 (13:18 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 19 Apr 2016 12:57:51 +0000 (14:57 +0200)
The language module should flush l10n caches after translation
update, otherwise translation changes have no immediate effect.

Change-Id: Ibf412293139e6fc82da243ba22d7d13d187add5e
Resolves: #75778
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47780
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/lang/Classes/Command/LanguageCommandController.php
typo3/sysext/lang/Classes/Controller/LanguageController.php

index e91f420..ba4d53b 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Lang\Command;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Package\PackageInterface;
 use TYPO3\CMS\Core\Package\PackageManager;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -93,6 +94,8 @@ class LanguageCommandController extends CommandController
                 $this->output->progressAdvance();
             }
         }
+        // Flush language cache
+        GeneralUtility::makeInstance(CacheManager::class)->getCache('l10n')->flush();
         $this->output->progressFinish();
     }
 
index 9a2bb7a..37c916d 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\Components\Menu\Menu;
 use TYPO3\CMS\Backend\Template\Components\Menu\MenuItem;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
+use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
@@ -180,6 +181,8 @@ class LanguageController extends ActionController
             $response['progress'] = $progress > 100 ? 100 : $progress;
         }
         $this->view->assign('response', $response);
+        // Flush language cache
+        GeneralUtility::makeInstance(CacheManager::class)->getCache('l10n')->flush();
     }
 
     /**
@@ -201,6 +204,8 @@ class LanguageController extends ActionController
             }
         }
         $this->view->assign('response', $response);
+        // Flush language cache
+        GeneralUtility::makeInstance(CacheManager::class)->getCache('l10n')->flush();
     }
 
     /**