The language audit checks the readability of English text content in web pages.
Currently, language_audit.py only checks the lang attribute on the html element to ensure the page is in English. It doesn't confirm that the text it is testing isn't in another language indicated by a lang attribute on one of the text's ancestor elements.
This means, for example, that Māori text in a div with lang="mi" will still be tested for readability if the page has <html lang="en-NZ">, when it should be excluded.
When the language audit is selecting text to test for readability, it should check that the text has not inherited a non-English language declaration from a lang attribute on an ancestor element. If the text being tested is marked up as not being in English, it should be excluded.
The language audit checks the readability of English text content in web pages.
Currently, language_audit.py only checks the
langattribute on thehtmlelement to ensure the page is in English. It doesn't confirm that the text it is testing isn't in another language indicated by alangattribute on one of the text's ancestor elements.This means, for example, that Māori text in a
divwithlang="mi"will still be tested for readability if the page has<html lang="en-NZ">, when it should be excluded.When the language audit is selecting text to test for readability, it should check that the text has not inherited a non-English language declaration from a
langattribute on an ancestor element. If the text being tested is marked up as not being in English, it should be excluded.