Skip to content

ChoiceType Field should have a choice_translation_parameters option. #36845

Closed
@VincentLanglet

Description

@VincentLanglet

Description

There is a label_translation_parameters option (cf https://symfony.com/doc/current/reference/forms/types/choice.html#label-translation-parameters). In the same way, there is a attr_translation_parameters and help_translation_parameters.

IMHO, a choice_translation_parameters option could be great.

Example

# translations/messages.en.yaml
form.order.ok: 'I want to confirm the order made to %company%'
form.order.ko: 'I want to cancel the order made to %company%'
$builder->add('order', null, [
    'choices' => [
        'form.order.ok' => true,
        'form.order.ko' => false,
    ],
    'choice_translation_parameters' => [
        '%company%' => 'ACME Inc.',
    ],
]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions