From 564db4cb02bd7d67bb0fc841341e957a5504aa69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bar=C3=A1=C5=A1ek?= Date: Fri, 15 Jan 2021 16:03:54 +0100 Subject: [PATCH] Translator is not required. --- src/CmsExtension.php | 1 + src/Context.php | 1 + src/Translator/CmsDefaultTranslator.php | 16 ++++++++++++++++ src/{ => Translator}/TranslatorFilter.php | 6 +++--- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/Translator/CmsDefaultTranslator.php rename src/{ => Translator}/TranslatorFilter.php (80%) diff --git a/src/CmsExtension.php b/src/CmsExtension.php index f751a26..b40ccde 100644 --- a/src/CmsExtension.php +++ b/src/CmsExtension.php @@ -12,6 +12,7 @@ use Baraja\Cms\Plugin\UserPlugin; use Baraja\Cms\Proxy\Proxy; use Baraja\Cms\Support\Support; +use Baraja\Cms\Translator\TranslatorFilter; use Baraja\Cms\User\UserManager; use Baraja\Cms\User\UserManagerAccessor; use Baraja\Doctrine\ORM\DI\OrmAnnotationsExtension; diff --git a/src/Context.php b/src/Context.php index 7eae9b9..b5250be 100644 --- a/src/Context.php +++ b/src/Context.php @@ -6,6 +6,7 @@ use Baraja\AdminBar\BasicPanel; +use Baraja\Cms\Translator\TranslatorFilter; use Baraja\Cms\User\UserManagerAccessor; use Baraja\Doctrine\EntityManager; use Baraja\DynamicConfiguration\Configuration; diff --git a/src/Translator/CmsDefaultTranslator.php b/src/Translator/CmsDefaultTranslator.php new file mode 100644 index 0000000..c9888f1 --- /dev/null +++ b/src/Translator/CmsDefaultTranslator.php @@ -0,0 +1,16 @@ +translator = $translator; + $this->translator = $translator ?? new CmsDefaultTranslator; }