-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Added support for using the "{{ label }}" placeholder in constraint messages #35338
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
Conversation
a-menshchikov
commented
Jan 14, 2020
•
edited
Loading
edited
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
Deprecations? | no |
Tickets | #12238 |
License | MIT |
Doc PR |
- Add docs PR
There is no support for |
src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php
Outdated
Show resolved
Hide resolved
I think this would need some examples - via tests maybe. Reviewing I'm wondering e.g. why doesn't the message go through translation? Why do we use str_replace instead of "label" as a translation variable? Should translating the label be done before or after humanize() by form? etc. All these may become more obvious with examples. |
6c0421b
to
8b1f111
Compare
Message into violation object already translated.
Since the message has already been translated, it makes no sense to translate it one more time with
There I've repeated translation logic from |
Maybe placeholder should be |
@nicolas-grekas what can I do to bring the review closer? |
8b1f111
to
99c153f
Compare
Any news on this pull request? |
01b14fd
to
47b92d4
Compare
@nicolas-grekas @xabbuh PR rebased on master and ready for review. |
32267a1
to
ff9bc3f
Compare
@xabbuh Could you review this PR? |
src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php
Outdated
Show resolved
Hide resolved
ff9bc3f
to
a86790f
Compare
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.
Just one minor comment. Apart from that the PR looks very good. 👍
src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php
Show resolved
Hide resolved
de52f9d
to
e8bedf6
Compare
e8bedf6
to
0d9f442
Compare
Thank you @a-menshchikov. |
@a-menshchikov Can you submit a PR for the docs? |
… constraint messages (a-menshchikov) This PR was squashed before being merged into the master branch. Discussion ---------- Added support for using the "{{ label }}" placeholder in constraint messages Docs for symfony/symfony#35338 Commits ------- e298929 Added support for using the "{{ label }}" placeholder in constraint messages