Skip to content

Commit c572e6c

Browse files
bug #26327 [Form][WCAG] Errors sign for people that do not see colors (Nyholm)
This PR was squashed before being merged into the 3.4 branch (closes #26327). Discussion ---------- [Form][WCAG] Errors sign for people that do not see colors | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | According to my friend and WCAG2 expect [Sandra](https://twitter.com/sandrability): > The form errors is correctly encoded and works great. But visually they may be hard to see for people that do not see colors very well. Try to improve errors with an icon to make it more visual clear that an error has occurred. ![screen shot 2018-02-26 at 17 42 01](https://user-images.githubusercontent.com/1275206/36802282-c81357c6-1cb4-11e8-843c-4592e3d597f9.png) Commits ------- 3f8cd05 [Form][WCAG] Errors sign for people that do not see colors
2 parents bacae4d + 3f8cd05 commit c572e6c

26 files changed

+103
-6
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
<div class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
265265
<ul class="list-unstyled mb-0">
266266
{%- for error in errors -%}
267-
<li>{{ error.message }}</li>
267+
<li><span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span></li>
268268
{%- endfor -%}
269269
</ul>
270270
</div>

src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public function testRow()
3434
[
3535
./div[
3636
./ul
37-
[./li[.="[trans]Error![/trans]"]]
37+
[./li
38+
[./span[.="[trans]Error[/trans]"]]
39+
[./span[.="[trans]Error![/trans]"]]
40+
]
3841
[count(./li)=1]
3942
]
4043
]

src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public function testRow()
3434
[
3535
./div[
3636
./ul
37-
[./li[.="[trans]Error![/trans]"]]
37+
[./li
38+
[./span[.="[trans]Error[/trans]"]]
39+
[./span[.="[trans]Error![/trans]"]]
40+
]
3841
[count(./li)=1]
3942
]
4043
]
@@ -166,9 +169,12 @@ public function testErrors()
166169
[@class="list-unstyled mb-0"]
167170
[
168171
./li
169-
[.="[trans]Error 1[/trans]"]
172+
[./span[.="[trans]Error[/trans]"]]
173+
[./span[.="[trans]Error 1[/trans]"]]
174+
170175
/following-sibling::li
171-
[.="[trans]Error 2[/trans]"]
176+
[./span[.="[trans]Error[/trans]"]]
177+
[./span[.="[trans]Error 2[/trans]"]]
172178
]
173179
[count(./li)=2]
174180
]

src/Symfony/Component/Form/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"symfony/doctrine-bridge": "<2.7",
4242
"symfony/framework-bundle": "<3.4",
4343
"symfony/http-kernel": "<3.3.5",
44-
"symfony/twig-bridge": "<3.4"
44+
"symfony/twig-bridge": "<3.4.5|<4.0.5,>=4.0"
4545
},
4646
"suggest": {
4747
"symfony/validator": "For form validation.",

src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315315
<target>Невалиден бизнес идентификационен код (BIC).</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Грешка</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315315
<target>Tato hodnota není platný identifikační kód podniku (BIC).</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Chyba</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.da.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@
242242
<source>This value is not a valid ISSN.</source>
243243
<target>Værdien er ikke en gyldig ISSN.</target>
244244
</trans-unit>
245+
<trans-unit id="82">
246+
<source>Error</source>
247+
<target>Fejl</target>
248+
</trans-unit>
245249
</body>
246250
</file>
247251
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.de.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315315
<target>Dieser Wert ist kein gültiger BIC.</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Fehler</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.en.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315315
<target>This is not a valid Business Identifier Code (BIC).</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Error</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.es.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315315
<target>No es un Código de Identificación Bancaria (BIC) válido.</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Error</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

0 commit comments

Comments
 (0)