10000 [Form] Added upgrade instructions to the UPGRADE file · symfony/symfony@1e34e91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e34e91

Browse files
committed
[Form] Added upgrade instructions to the UPGRADE file
1 parent b94a256 commit 1e34e91

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

UPGRADE-2.2.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@
6464
Symfony\Component\Form\Exception namespace or to create custom exception
6565
classes for your purpose.
6666

67+
* Translating validation errors is now optional. You can still do so
68+
manually if you like, or you can simplify your templates to simply output
69+
the already translated message.
70+
71+
Before:
72+
73+
```
74+
{{
75+
error.messagePluralization is null
76+
? error.messageTemplate|trans(error.messageParameters, 'validators')
77+
: error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators')
78+
}}
79+
```
80+
81+
After:
82+
83+
```
84+
{{ error.message }}
85+
```
86+
6787
#### Deprecations
6888

6989
* The methods `getParent()`, `setParent()` and `hasParent()` in

0 commit comments

Comments
 (0)
0