[Translator] Warm up the translations cache in dev

This commit is contained in:
Titouan Galopin 2019-04-06 19:05:56 +02:00
parent 86210b3fa1
commit a5f1afca15

View File

@ -11,12 +11,13 @@
namespace Symfony\Component\Translation; namespace Symfony\Component\Translation;
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
use Symfony\Component\Translation\Exception\InvalidArgumentException; use Symfony\Component\Translation\Exception\InvalidArgumentException;
/** /**
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com> * @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
*/ */
class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface, WarmableInterface
{ {
const MESSAGE_DEFINED = 0; const MESSAGE_DEFINED = 0;
const MESSAGE_MISSING = 1; const MESSAGE_MISSING = 1;
@ -87,6 +88,14 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
return $this->translator->getCatalogue($locale); return $this->translator->getCatalogue($locale);
} }
/**
* {@inheritdoc}
*/
public function warmUp($cacheDir)
{
return $this->translator->warmUp($cacheDir);
}
/** /**
* Gets the fallback locales. * Gets the fallback locales.
* *