Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the past we decided¹ to remove the `lang` attribute due to the fact that developers were often forgetting to update its value. This change turned out not to be the best solution because some of the users: * didn't read the documentation, and thus, they found the absence of the `lang` attribute confusing, or didn't even knew they had to add it * didn't notice the absence of the `lang` attribute, and thus, forgot to include it (expecting it to be there) To make things more clearer and to remind users that they need to specify the primary language of the document, this commit reintroduces the `lang` attribute, while leaving its value to `""`. Using `lang=""` has the exact same effect as not specifying the `lang` attribute at all, in both cases the language being treated as unknown². - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ¹ h5bp/html5-boilerplate#1110 ² From WHATWG (http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#attr-lang): "To determine the language of a node, user agents must look at the nearest ancestor element (including the element itself if the node is an element) that has a lang attribute in the XML namespace set or is an HTML element and has a lang in no namespace attribute set. That attribute specifies the language of the node (regardless of its value). If both the lang attribute in no namespace and the lang attribute in the XML namespace are set on an element, user agents must use the lang attribute in the XML namespace, and the lang attribute in no namespace must be ignored for the purposes of determining the element's language. If neither the node nor any of the node's ancestors, including the root element, have either attribute set, but there is a pragma-set default language set, then that is the language of the node. If there is no pragma-set default language set, then language information from a higher-level protocol (such as HTTP), if any, must be used as the final fallback language instead. In the absence of any such language information, and in cases where the higher-level protocol reports multiple languages, the language of the node is unknown, and the corresponding language tag is the empty string. If the resulting value is not a recognized language tag, then it must be treated as an unknown language having the given language tag, distinct from all other languages." - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Close h5bp/html5-boilerplate#1542.
- Loading branch information