Thanks to visit codestin.com
Credit goes to github.com

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>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@
278278
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
279279
<target>Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar.</target>
280280
</trans-unit>
281+
<trans-unit id="82">
282+
<source>Error</source>
283+
<target>Errore</target>
284+
</trans-unit>
281285
</body>
282286
</file>
283287
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@
222222
<source>Unsupported card type or invalid card number.</source>
223223
<target>Tätä korttityyppiä ei tueta tai korttinumero on virheellinen.</target>
224224
</trans-unit>
225+
<trans-unit id="82">
226+
<source>Error</source>
227+
<target>Virhe</target>
228+
</trans-unit>
225229
</body>
226230
</file>
227231
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.fr.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>Ce n'est pas un code universel d'identification des banques (BIC) valide.</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Erreur</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.hr.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>Ovo nije validan poslovni identifikacijski broj (BIC).</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Greška</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.hu.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>Érvénytelen nemzetközi bankazonosító kód (BIC/SWIFT).</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Hiba</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.it.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>Questo valore non è un codice BIC valido.</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Errore</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@
302302
<source>An empty file is not allowed.</source>
303303
<target>Failas negali būti tuščias.</target>
304304
</trans-unit>
305+
<trans-unit id="82">
306+
<source>Error</source>
307+
<target>Klaida</target>
308+
</trans-unit>
305309
</body>
306310
</file>
307311
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@
310310
<source>This is not a valid Business Identifier Code (BIC).</source>
311311
<target>Dit is geen geldige bedrijfsidentificatiecode (BIC/SWIFT).</target>
312312
</trans-unit>
313+
<trans-unit id="82">
314+
<source>Error</source>
315+
<target>Fout</target>
316+
</trans-unit>
313317
</body>
314318
</file>
315319
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.pl.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>Ta wartość nie jest poprawnym kodem BIC (Business Identifier Code).</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Błąd</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@
302302
<source>An empty file is not allowed.</source>
303303
<target>Ficheiro vazio não é permitido.</target>
304304
</trans-unit>
305+
<trans-unit id="82">
306+
<source>Error</source>
307+
<target>Erro</target>
308+
</trans-unit>
305309
</body>
306310
</file>
307311
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@
278278
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
279279
<target>Această valoare nu trebuie să fie identică cu {{ compared_value_type }} {{ compared_value }}.</target>
280280
</trans-unit>
281+
<trans-unit id="82">
282+
<source>Error</source>
283+
<target>Eroare</target>
284+
</trans-unit>
281285
</body>
282286
</file>
283287
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@
310310
<source>This value does not match the expected {{ charset }} charset.</source>
311311
<target>Значение не совпадает с ожидаемой {{ charset }} кодировкой.</target>
312312
</trans-unit>
313+
<trans-unit id="82">
314+
<source>Error</source>
315+
<target>Ошибка</target>
316+
</trans-unit>
313317
</body>
314318
</file>
315319
</xliff>

src/Symfony/Component/Validator/Resources/translations/validators.sv.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>Detta är inte en giltig BIC-kod.</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Fel</target>
320+
</trans-unit>
317321
</body>
318322
</file>
319323
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@
222222
<source>Unsupported card type or invalid card number.</source>
223223
<target>Desteklenmeyen kart tipi veya geçersiz kart numarası.</target>
224224
</trans-unit>
225+
<trans-unit id="82">
226+
<source>Error</source>
227+
<target>Hata</target>
228+
</trans-unit>
225229
</body>
226230
</file>
227231
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@
278278
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
279279
<target>Значення не повинно бути ідентичним {{ compared_value_type }} {{ compared_value }}.</target>
280280
</trans-unit>
281+
<trans-unit id="82">
282+
<source>Error</source>
283+
<target>Помилка</target>
284+
</trans-unit>
281285
</body>
282286
</file>
283287
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@
310310
<source>This value does not match the expected {{ charset }} charset.</source>
311311
<target>该值不符合 {{ charset }} 编码。</target>
312312
</trans-unit>
313+
<trans-unit id="82">
314+
<source>Error</source>
315+
<target>错误</target>
316+
</trans-unit>
313317
</body>
314318
</file>
315319
</xliff>

0 commit comments

Comments
 (0)