Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Translation] domain of TranslatableMessage ignored in Contraint/Length #62354

Closed as not planned
@ryckblick

Description

@ryckblick

Symfony version(s) affected

7.3

Description

When using a TranslatableMessage with an explicitly set domain in a Constraint/Length minMessage the passed domain is ignored and reset to 'validators'.

How to reproduce

class RegistrationFormTypeextends AbstractType{publicfunctionbuildForm(FormBuilderInterface$builder,array$options):void    {$builder            ...            ->add('plainPassword', PasswordType::class, [// ...'constraints' => [// ...newLength(['min' =>8,'minMessage' =>newTranslatableMessage('registration.password.min', [],'forms'),'max' =>4096,                    ]),                ],            ])        ;    }

forms.en.yaml

registration:password:min:'Your password should be at least {{ limit }} characters'

WebProfiler shows, that Symfony is looking for 'registration.password.min' inside validators domain ignoring the set domain. If you put the same config in validators.en.yaml it works.

I use TranslatableMessage in other constraints aswell and there the passed domain is used.

Possible Solution

No response

Additional Context

No response

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp