mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-03 07:26:12 +00:00
Fix translations of form fields in admin for social actions
This commit is contained in:
parent
8ed5e35f1a
commit
6f7015b152
6
.changes/unreleased/Fixed-20250702-135534.yaml
Normal file
6
.changes/unreleased/Fixed-20250702-135534.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
kind: Fixed
|
||||
body: 'Fix translations for social action fields in admin form: results, goals, evaluations'
|
||||
time: 2025-07-02T13:55:34.599050626+02:00
|
||||
custom:
|
||||
Issue: ""
|
||||
SchemaChange: No schema change
|
@ -25,21 +25,14 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* Class SocialActionType.
|
||||
*/
|
||||
class SocialActionType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* @var TranslatableStringHelper
|
||||
*/
|
||||
protected $translatableStringHelper;
|
||||
|
||||
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
@ -64,6 +57,7 @@ class SocialActionType extends AbstractType
|
||||
->add('results', EntityType::class, [
|
||||
'class' => Result::class,
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('person_admin.social_result'),
|
||||
'multiple' => true,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'choice_label' => fn (Result $r) => $this->translatableStringHelper->localize($r->getTitle()),
|
||||
@ -74,6 +68,7 @@ class SocialActionType extends AbstractType
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'label' => $this->translator->trans('person_admin.social_goal'),
|
||||
'choice_label' => fn (Goal $g) => $this->translatableStringHelper->localize($g->getTitle()),
|
||||
])
|
||||
|
||||
@ -82,6 +77,7 @@ class SocialActionType extends AbstractType
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'label' => $this->translator->trans('person_admin.social_evaluation'),
|
||||
'choice_label' => fn (Evaluation $e) => $this->translatableStringHelper->localize($e->getTitle()),
|
||||
])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user