HTML and CSS Reference
Introduce lang Attributes
Add lang and xml:lang attributes to each root element identifying the primary language of the document. Add
superseding lang and xml:lang attributes to any element in that document that is written in a different
<p>Pierre shouted, "Vive la France!"</p>
"<span lang="fr" xml:lang="en-US">Vive la France!</span>"
Proper language identification is important for pronunciation by screen readers.
Language identification also assists search engines. Your French pages are more likely to be picked up by
google.fr and your German pages by google.de if the content is properly tagged.
Finally, language identification assists you when authoring pages, especially when working in something other
than a system's primary language. It enables editors to choose the proper dictionary for spell checking.
None. This is only for the good.
If you know none of your documents already contains a lang or xml:lang attribute, and that they're all written
in the same language, it's easy to search for <html and replace it with <html lang='en' xml:lang='en' .
If you aren't certain whether there are any such attributes already, try searching for lang\s*=\s*['"a-zA-z] .
If nothing turns up, it's highly likely that there aren't any.
If you do find that some of your documents have such attributes already and some don't, the following regular