From e6e8079dc088459eca6a7fbb7e8b5c6046df53f9 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 1 Mar 2022 19:02:11 +0100 Subject: [PATCH] backports murph-skeleton --- core/EventSuscriber/Site/MenuEventSubscriber.php | 8 ++++++-- core/Resources/translations/messages.fr.yaml | 1 + core/Resources/views/admin/module/metas.html.twig | 14 ++------------ core/Resources/views/analytic/stats.html.twig | 6 +++--- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/core/EventSuscriber/Site/MenuEventSubscriber.php b/core/EventSuscriber/Site/MenuEventSubscriber.php index 1edc129..4f2dbea 100644 --- a/core/EventSuscriber/Site/MenuEventSubscriber.php +++ b/core/EventSuscriber/Site/MenuEventSubscriber.php @@ -11,6 +11,7 @@ use App\Core\Factory\Site\NodeFactory; use App\Core\Manager\EntityManager; use App\Core\Repository\Site\NodeRepository; use App\Core\Slugify\CodeSlugify; +use Symfony\Contracts\Translation\TranslatorInterface; /** * class MenuEventSubscriber. @@ -24,19 +25,22 @@ class MenuEventSubscriber extends EntityManagerEventSubscriber protected EntityManager $entityManager; protected CodeSlugify $slugify; protected SymfonyCacheManager $cacheManager; + protected TranslatorInterface $translation; public function __construct( NodeFactory $nodeFactory, NodeRepository $nodeRepository, EntityManager $entityManager, CodeSlugify $slugify, - SymfonyCacheManager $cacheManager + SymfonyCacheManager $cacheManager, + TranslatorInterface $translator ) { $this->nodeFactory = $nodeFactory; $this->nodeRepository = $nodeRepository; $this->entityManager = $entityManager; $this->slugify = $slugify; $this->cacheManager = $cacheManager; + $this->translator = $translator; } public function support(EntityInterface $entity) @@ -75,7 +79,7 @@ class MenuEventSubscriber extends EntityManagerEventSubscriber $childNode = $this->nodeFactory->create($menu, '/'); $childNode ->setParent($rootNode) - ->setLabel('Premier élément') + ->setLabel($this->translator->trans('First element')) ; $menu->setRootNode($rootNode); diff --git a/core/Resources/translations/messages.fr.yaml b/core/Resources/translations/messages.fr.yaml index 83e5f44..f9fc7f6 100644 --- a/core/Resources/translations/messages.fr.yaml +++ b/core/Resources/translations/messages.fr.yaml @@ -213,3 +213,4 @@ "Enable": "Activer" "Disable": "Désactiver" "Reuse the query string": "Réutiliser la chaîne de requête" +"First element": "Premier élément" diff --git a/core/Resources/views/admin/module/metas.html.twig b/core/Resources/views/admin/module/metas.html.twig index 1689fba..bcbdcf3 100644 --- a/core/Resources/views/admin/module/metas.html.twig +++ b/core/Resources/views/admin/module/metas.html.twig @@ -1,14 +1,4 @@ - - - - - - - - - - - - + + diff --git a/core/Resources/views/analytic/stats.html.twig b/core/Resources/views/analytic/stats.html.twig index 0658460..7e6fb63 100644 --- a/core/Resources/views/analytic/stats.html.twig +++ b/core/Resources/views/analytic/stats.html.twig @@ -41,7 +41,7 @@
-
+
@@ -55,7 +55,7 @@ {% for path, views in pathViews %} - + @@ -77,7 +77,7 @@ -
+
{{ path }}{{ path }} {{ views.views }} {{ views.desktopViews }} {{ views.mobileViews }}