From 935210aa1dcb7222437c9b27ad959ff74be8ad62 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 4 Oct 2023 11:54:29 +0200 Subject: [PATCH] use translation --- .../Templating/Entity/ClosingMotiveRender.php | 5 +++-- src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php index b574382ad..bdff04a22 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php @@ -16,6 +16,7 @@ use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait; use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive; +use Symfony\Contracts\Translation\TranslatorInterface; /** * Render closing motive. @@ -32,7 +33,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface */ private $translatableStringHelper; - public function __construct(TranslatableStringHelper $translatableStringHelper) + public function __construct(TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) { $this->translatableStringHelper = $translatableStringHelper; } @@ -62,7 +63,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface private function renderStringRecursive(ClosingMotive $motive, string $existing, array $options) { $newExisting = $this->translatableStringHelper->localize($motive->getName()); - $isCancled = $motive->getIsCanceledAccompanyingPeriod() ? '( Annule le parcours )' : ''; + $isCancled = $motive->getIsCanceledAccompanyingPeriod() ? $this->translator->trans('( Canceled period )') : ''; if ($motive->hasParent()) { if ('' !== $existing) { diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 2496a4555..aea766902 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -351,6 +351,7 @@ Period closed!: Parcours clôturé! Pediod closing form is not valide: Le formulaire de fermeture n'est pas valide Consider canceled: Permet de considérer les parcours comme annulés Canceled parcours help: Si coché, les parcours avec ce motif de cloture seront considérés comme annulés et ne seront pas pris en compte pour les statistiques. La modification se reflétera pour tous les motifs enfants +( Canceled period ): ( annulé ) #widget