lexik/LexikTranslationBundle — pull request #44 by passkey1510 (2013-11-29 10:06:01+00:00)
Title: Change remove cache file behavior

Use case:

We have fr and en in our manage locales. In some case, our user has fr, fr_FR, en, en_US as locale, therefore when Symfony generates the translation cache, there are 4 different "locales" that are created. The translation editor has only fr and en resource since they are the only manage locales. When invalidating cache, only catalogue.fr.php and catalogue.en.php are removed, which is not the desired behavior since we want catalogue.fr_FR.php and catalogue.en_US.php to be removed accordingly.

Therefore, I think it should be safe to remove cache file by regex pattern and it the worst case, the cache will be regenerated during the next request.