use translation

This commit is contained in:
2023-10-04 11:54:29 +02:00
parent 9f476dddaf
commit 935210aa1d
2 changed files with 4 additions and 2 deletions

View File

@@ -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) {