use translatablestringhelper

This commit is contained in:
2022-08-09 16:13:24 +02:00
parent ed1dde4713
commit 9a2af662c0
4 changed files with 21 additions and 14 deletions

View File

@@ -12,21 +12,23 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Export\Aggregator\PersonAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Repository\MaritalStatusRepository;
use Doctrine\ORM\QueryBuilder;
use LogicException;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
final class MaritalStatusAggregator implements AggregatorInterface
{
private MaritalStatusRepository $maritalStatusRepository;
public function __construct(MaritalStatusRepository $maritalStatusRepository)
private TranslatableStringHelper $translatableStringHelper;
public function __construct(MaritalStatusRepository $maritalStatusRepository, TranslatableStringHelper $translatableStringHelper)
{
$this->maritalStatusRepository = $maritalStatusRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
@@ -66,7 +68,7 @@ final class MaritalStatusAggregator implements AggregatorInterface
$g = $this->maritalStatusRepository->find($value);
return $g->getName()['fr'];
return $this->translatableStringHelper->localize($g->getName());
};
}