HTML_CodeSniffer is a client-side JavaScript application that checks a HTML document or source code, and detects violations of a defined coding standard. Comes with standards that cover the three conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.0 and the U.S. Section 508 legislation.
What does this PR solve?
It propagates the translation error when a translation isn't found for a given key (or if the language doesn't exist).
My colleague and I ran into this issue today while running pa11y where a missing translation resulted in an Uncaught TypeError: Cannot read property 'replace' of undefined from this package. I think this should take care of it, so we would get the right error propagated instead :)
My colleague created a minimal-reproduction-repo where you can see the error. If you use npm link to link HTML_CodeSniffer to this branch instead you can see the actual translation error getting propagated.
The weird thing though is that the specific key (1_3_5_H98.InvalidAutoComplete_Text) it complained about isn't missing in the translation file (en.js). I haven't had the time to look into that bit, but this get us halfway there :)
What does this PR solve? It propagates the translation error when a translation isn't found for a given key (or if the language doesn't exist).
My colleague and I ran into this issue today while running pa11y where a missing translation resulted in an
Uncaught TypeError: Cannot read property 'replace' of undefined
from this package. I think this should take care of it, so we would get the right error propagated instead :)My colleague created a minimal-reproduction-repo where you can see the error. If you use
npm link
to link HTML_CodeSniffer to this branch instead you can see the actual translation error getting propagated.The weird thing though is that the specific key (
1_3_5_H98.InvalidAutoComplete_Text
) it complained about isn't missing in the translation file (en.js
). I haven't had the time to look into that bit, but this get us halfway there :)