Skip to content

Commit 1b16d62

Browse files
committed
Merge translate on 15.03.2018 from master SquizLabs HTM_CodeSniffer
Suggestion: To load files with the server depending on the browser language.
1 parent 5388657 commit 1b16d62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+189
-200
lines changed

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_1/1_1_1.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,39 +65,39 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
6565
var errors = this.testNullAltText(top);
6666

6767
for (var i = 0; i < errors.img.emptyAltInLink.length; i++) {
68-
HTMLCS.addMessage(HTMLCS.ERROR, errors.img.emptyAltInLink[i], 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.', 'H30.2');
68+
HTMLCS.addMessage(HTMLCS.ERROR, errors.img.emptyAltInLink[i], _global.translation["1_1_1_H30.2"], 'H30.2');
6969
}
7070

7171
for (var i = 0; i < errors.img.nullAltWithTitle.length; i++) {
72-
HTMLCS.addMessage(HTMLCS.ERROR, errors.img.nullAltWithTitle[i], 'Img element with empty alt text must have absent or empty title attribute.', 'H67.1');
72+
HTMLCS.addMessage(HTMLCS.ERROR, errors.img.nullAltWithTitle[i], _global.translation["1_1_1_H67.1"], 'H67.1');
7373
}
7474

7575
for (var i = 0; i < errors.img.ignored.length; i++) {
76-
HTMLCS.addMessage(HTMLCS.WARNING, errors.img.ignored[i], 'Img element is marked so that it is ignored by Assistive Technology.', 'H67.2');
76+
HTMLCS.addMessage(HTMLCS.WARNING, errors.img.ignored[i], _global.translation["1_1_1_H67.2"], 'H67.2');
7777
}
7878

7979
for (var i = 0; i < errors.img.missingAlt.length; i++) {
80-
HTMLCS.addMessage(HTMLCS.ERROR, errors.img.missingAlt[i], 'Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.', 'H37');
80+
HTMLCS.addMessage(HTMLCS.ERROR, errors.img.missingAlt[i], errors.img.ignored[i], _global.translation["1_1_1_H37"], 'H37');
8181
}
8282

8383
for (var i = 0; i < errors.img.generalAlt.length; i++) {
84-
HTMLCS.addMessage(HTMLCS.NOTICE, errors.img.generalAlt[i], 'Ensure that the img element\'s alt text serves the same purpose and presents the same information as the image.', 'G94.Image');
84+
HTMLCS.addMessage(HTMLCS.NOTICE, errors.img.generalAlt[i], _global.translation["1_1_1_G94.Image"], 'G94.Image');
8585
}
8686

8787
for (var i = 0; i < errors.inputImage.missingAlt.length; i++) {
88-
HTMLCS.addMessage(HTMLCS.ERROR, errors.inputImage.missingAlt[i], 'Image submit button missing an alt attribute. Specify a text alternative that describes the button\'s function, using the alt attribute.', 'H36');
88+
HTMLCS.addMessage(HTMLCS.ERROR, errors.inputImage.missingAlt[i], _global.translation["1_1_1_H36"], 'H36');
8989
}
9090

9191
for (var i = 0; i < errors.inputImage.generalAlt.length; i++) {
92-
HTMLCS.addMessage(HTMLCS.NOTICE, errors.inputImage.generalAlt[i], 'Ensure that the image submit button\'s alt text identifies the purpose of the button.', 'G94.Button');
92+
HTMLCS.addMessage(HTMLCS.NOTICE, errors.inputImage.generalAlt[i], _global.translation["1_1_1_G94.Button"], 'G94.Button');
9393
}
9494

9595
for (var i = 0; i < errors.area.missingAlt.length; i++) {
96-
HTMLCS.addMessage(HTMLCS.ERROR, errors.area.missingAlt[i], 'Area element in an image map missing an alt attribute. Each area element must have a text alternative that describes the function of the image map area.', 'H24');
96+
HTMLCS.addMessage(HTMLCS.ERROR, errors.area.missingAlt[i], _global.translation["1_1_1_H24"], 'H24');
9797
}
9898

9999
for (var i = 0; i < errors.area.generalAlt.length; i++) {
100-
HTMLCS.addMessage(HTMLCS.NOTICE, errors.area.generalAlt[i], 'Ensure that the area element\'s text alternative serves the same purpose as the part of image map image it references.', 'H24.2');
100+
HTMLCS.addMessage(HTMLCS.NOTICE, errors.area.generalAlt[i], _global.translation["1_1_1_H24.2"], 'H24.2');
101101
}
102102
},
103103

@@ -232,8 +232,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
232232
*/
233233
testLongdesc: function(element)
234234
{
235-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this image cannot be fully described in a short text alternative, ensure a long text alternative is also available, such as in the body text or through a link.', 'G73,G74');
236-
235+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_1_1_G73,G74"], 'G73,G74');
237236
},
238237

239238
/**
@@ -274,7 +273,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
274273
// H2 "Failure Example 5": they're in one link, but the alt text
275274
// duplicates the link text. Trimmed and lowercased because they
276275
// would sound the same to a screen reader.
277-
HTMLCS.addMessage(HTMLCS.ERROR, element, 'Img element inside a link must not use alt text that duplicates the text content of the link.', 'H2.EG5');
276+
HTMLCS.addMessage(HTMLCS.ERROR, element, _global.translation["1_1_1_H2.EG5"], 'H2.EG5');
278277
}
279278
}
280279

@@ -316,18 +315,18 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
316315
// Test against the following link, if any.
317316
if (nodes.next && (nodes.next.href !== '') && (nodes.next.href !== null) && (nodes.anchor.href === nodes.next.href)) {
318317
if ((nodes.next.text !== '') && (nodes.anchor.alt === '')) {
319-
HTMLCS.addMessage(HTMLCS.ERROR, element, 'Img element inside a link has empty or missing alt text when a link beside it contains link text. Consider combining the links.', 'H2.EG4');
318+
HTMLCS.addMessage(HTMLCS.ERROR, element, _global.translation["1_1_1_H2.EG4"], 'H2.EG4');
320319
} else if (nodes.next.text.toLowerCase() === nodes.anchor.alt.toLowerCase()) {
321-
HTMLCS.addMessage(HTMLCS.ERROR, element, 'Img element inside a link must not use alt text that duplicates the content of a text link beside it.', 'H2.EG3');
320+
HTMLCS.addMessage(HTMLCS.ERROR, element, _global.translation["1_1_1_H2.EG3"], 'H2.EG3');
322321
}
323322
}
324323

325324
// Test against the preceding link, if any.
326325
if (nodes.previous && (nodes.previous.href !== '') && (nodes.previous.href !== null) && (nodes.anchor.href === nodes.previous.href)) {
327326
if ((nodes.previous.text !== '') && (nodes.anchor.alt === '')) {
328-
HTMLCS.addMessage(HTMLCS.ERROR, element, 'Img element inside a link has empty or missing alt text when a link beside it contains link text. Consider combining the links.', 'H2.EG4');
327+
HTMLCS.addMessage(HTMLCS.ERROR, element, _global.translation["1_1_1_H2.EG4"], 'H2.EG4');
329328
} else if (nodes.previous.text.toLowerCase() === nodes.anchor.alt.toLowerCase()) {
330-
HTMLCS.addMessage(HTMLCS.ERROR, element, 'Img element inside a link must not use alt text that duplicates the content of a text link beside it.', 'H2.EG3');
329+
HTMLCS.addMessage(HTMLCS.ERROR, element, _global.translation["1_1_1_H2.EG3"]);
331330
}
332331
}
333332
}//end if
@@ -347,23 +346,23 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
347346
var errors = this.testMediaTextAlternatives(top);
348347

349348
for (var i = 0; i < errors.object.missingBody.length; i++) {
350-
HTMLCS.addMessage(HTMLCS.ERROR, errors.object.missingBody[i], 'Object elements must contain a text alternative after all other alternatives are exhausted.', 'H53,ARIA6');
349+
HTMLCS.addMessage(HTMLCS.ERROR, errors.object.missingBody[i], _global.translation["1_1_1_H53,ARIA6"], 'H53,ARIA6');
351350
}
352351

353352
for (var i = 0; i < errors.object.generalAlt.length; i++) {
354-
HTMLCS.addMessage(HTMLCS.NOTICE, errors.object.generalAlt[i], 'Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.', 'G94,G92.Object,ARIA6');
353+
HTMLCS.addMessage(HTMLCS.NOTICE, errors.object.generalAlt[i], _global.translation["1_1_1_G94,G92.Object,ARIA6"], 'G94,G92.Object,ARIA6');
355354
}
356355

357356
for (var i = 0; i < errors.applet.missingBody.length; i++) {
358-
HTMLCS.addMessage(HTMLCS.ERROR, errors.applet.missingBody[i], 'Applet elements must contain a text alternative in the element\'s body, for browsers without support for the applet element.', 'H35.3');
357+
HTMLCS.addMessage(HTMLCS.ERROR, errors.applet.missingBody[i], _global.translation["1_1_1_H35.3"], 'H35.3');
359358
}
360359

361360
for (var i = 0; i < errors.applet.missingAlt.length; i++) {
362-
HTMLCS.addMessage(HTMLCS.ERROR, errors.applet.missingAlt[i], 'Applet elements must contain an alt attribute, to provide a text alternative to browsers supporting the element but are unable to load the applet.', 'H35.2');
361+
HTMLCS.addMessage(HTMLCS.ERROR, errors.applet.missingAlt[i], _global.translation["1_1_1_H35.2"], 'H35.2');
363362
}
364363

365364
for (var i = 0; i < errors.applet.generalAlt.length; i++) {
366-
HTMLCS.addMessage(HTMLCS.NOTICE, errors.applet.generalAlt[i], 'Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.', 'G94,G92.Applet');
365+
HTMLCS.addMessage(HTMLCS.NOTICE, errors.applet.generalAlt[i], _global.translation["1_1_1_G94,G92.Applet"], 'G94,G92.Applet');
367366
}
368367
},
369368

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_1 = {
4444
var nodeName = element.nodeName.toLowerCase();
4545

4646
if (nodeName !== 'video') {
47-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded audio only, and is not provided as an alternative for text content, check that an alternative text version is available.', 'G158');
47+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_1_G158"], 'G158');
4848
}
4949

5050
if ((nodeName !== 'bgsound') && (nodeName !== 'audio')) {
51-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded video only, and is not provided as an alternative for text content, check that an alternative text version is available, or an audio track is provided that presents equivalent information.', 'G159,G166');
51+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_1_G159,G166"], 'G159,G166');
5252
}
5353

5454
}

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_2 = {
3939
*/
4040
process: function(element, top)
4141
{
42-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded synchronised media and is not provided as an alternative for text content, check that captions are provided for audio content.', 'G87,G93');
42+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_2_G87,G93"], 'G87,G93');
4343

4444
}
4545
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_3 = {
3939
*/
4040
process: function(element, top)
4141
{
42-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded synchronised media and is not provided as an alternative for text content, check that an audio description of its video, and/or an alternative text version of the content is provided.', 'G69,G78,G173,G8');
42+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_3_G69,G78,G173,G8"], 'G69,G78,G173,G8');
4343

4444
}
4545
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_4 = {
3939
*/
4040
process: function(element, top)
4141
{
42-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains synchronised media, check that captions are provided for live audio content.', 'G9,G87,G93');
42+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_4_G9,G87,G93"], 'G9,G87,G93');
4343

4444
}
4545
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_5 = {
3939
*/
4040
process: function(element, top)
4141
{
42-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded synchronised media, check that an audio description is provided for its video content.', 'G78,G173,G8');
42+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_5_G78,G173,G8"], 'G78,G173,G8');
4343

4444
}
4545
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_6 = {
3939
*/
4040
process: function(element, top)
4141
{
42-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded synchronised media, check that a sign language interpretation is provided for its audio.', 'G54,G81');
42+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_6_G54,G81"], 'G54,G81');
4343

4444
}
4545
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_7.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_7 = {
4040
process: function(element, top)
4141
{
4242
// Check for elements that could potentially contain video.
43-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains synchronised media, and where pauses in foreground audio is not sufficient to allow audio descriptions to convey the sense of pre-recorded video, check that an extended audio description is provided, either through scripting or an alternate version.', 'G8');
43+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_7_G8"], 'G8');
4444

4545
}
4646
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_8.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_8 = {
3939
*/
4040
process: function(element, top)
4141
{
42-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains pre-recorded synchronised media or video-only content, check that an alternative text version of the content is provided.', 'G69,G159');
42+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_8_G69,G159"], 'G69,G159');
4343

4444
}
4545
};

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_9.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_9 = {
4040
*/
4141
process: function(element, top)
4242
{
43-
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'If this embedded object contains live audio-only content, check that an alternative text version of the content is provided.', 'G150,G151,G157');
43+
HTMLCS.addMessage(HTMLCS.NOTICE, element, _global.translation["1_2_9_G150,G151,G157"], 'G150,G151,G157');
4444

4545
}
4646
};

0 commit comments

Comments
 (0)