From a5f1afca15e26b1b886d85a357e1370d7c479e47 Mon Sep 17 00:00:00 2001 From: Titouan Galopin Date: Sat, 6 Apr 2019 19:05:56 +0200 Subject: [PATCH] [Translator] Warm up the translations cache in dev --- .../Component/Translation/DataCollectorTranslator.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Translation/DataCollectorTranslator.php b/src/Symfony/Component/Translation/DataCollectorTranslator.php index 6f826dfaa6ff..c0cc05996aa3 100644 --- a/src/Symfony/Component/Translation/DataCollectorTranslator.php +++ b/src/Symfony/Component/Translation/DataCollectorTranslator.php @@ -11,12 +11,13 @@ namespace Symfony\Component\Translation; +use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; use Symfony\Component\Translation\Exception\InvalidArgumentException; /** * @author Abdellatif Ait boudad */ -class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface +class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface, WarmableInterface { const MESSAGE_DEFINED = 0; const MESSAGE_MISSING = 1; @@ -87,6 +88,14 @@ public function getCatalogue($locale = null) return $this->translator->getCatalogue($locale); } + /** + * {@inheritdoc} + */ + public function warmUp($cacheDir) + { + return $this->translator->warmUp($cacheDir); + } + /** * Gets the fallback locales. *