-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support to extract translations from form constraints #546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this! I think that is a very nice feature! 🎉
can you provide tests for it?
@@ -43,6 +44,9 @@ public function buildForm(FormBuilderInterface $builder, array $options) | |||
->add('street', 'text', [ | |||
'label' => /** @Desc("Street") */ 'form.label.street', | |||
'translation_domain' => 'address', | |||
'constraints' => [ | |||
new NotBlank(['message' => /** @Desc("You should fill in the street") */ 'form.street.empty_value']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what is this @Desc("You should fill in the street")
comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @goetas. @Desc
adds a default text into the translation file, and I,ve added it to test if it works as for the other options of the form (choices
, etc)
The feature is tested, please check the FormExtractor
tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@goetas Is there anything else I should do on the PR?
thanks ! |
👍 Thank you too! |
@goetas Can you also create a release, please? |
Description
Added extraction from form
constraints
node.Todos