Skip to content
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

Merged
merged 2 commits into from
Aug 13, 2020

Conversation

balazscsaba2006
Copy link

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #374
License Apache2

Description

Added extraction from form constraints node.

Todos

  • Tests
  • Documentation
  • Changelog

Copy link
Collaborator

@goetas goetas left a 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']),
Copy link
Collaborator

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?

Copy link
Author

@balazscsaba2006 balazscsaba2006 Aug 7, 2020

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.

Copy link
Author

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?

@goetas goetas merged commit b5c84d2 into schmittjoh:master Aug 13, 2020
@goetas
Copy link
Collaborator

goetas commented Aug 13, 2020

thanks !

@balazscsaba2006
Copy link
Author

thanks !

👍 Thank you too!

@balazscsaba2006
Copy link
Author

@goetas Can you also create a release, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants