The W3C HTML5 Validator has been enhanced with functionality that detects the overall language of a page. The validator can currently detect a little over 50 languages, but more will be added over time.
This makes it possible to compare the language of the content in a page with language declarations, and issue warnings if the
lang attribute does not match the language of content, if no
lang attribute is given at all, or if a language using a right-to-left script is detected but a
dir attribute is missing from the
Source: Web Design