-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove lang
attribute from html
#1110
Comments
If we remove this then we would see a lot of site without lang attribute. I think it helps developers to remember that they should declare a primary language for the site. Maybe to add a reminder comment instead remove? |
Few people read those comments. I've seen plenty of sites in the wild with the wrong lang code. |
It reminds me to change lang, so keep it please. |
-1 on removing it just because people are using it wrong. |
I agree with @nautilus7. -1 on removing |
It's called html5 boilerplate for a reason. |
Sorry man, but there are wider considerations than that :)
What I'm concerned about is that this project is resulting in people using it incorrectly. Just like you modify a design when people struggle to interact with your product, you should modify code when the defaults repeatedly allow people to make errors...especially in a project that people look to as a "no surprises" default package. Seeing a whole bunch of french, german, and spanish websites with Have I convinced you that this change should have a positive effect avoid perpetuating non-english language websites that have |
Agreed with @necolas here. People do not change defaults and lang=en is not sadly the best default. Perhaps we could create a checklist task in the node build script that would check for such critical settings? But agreed on removing it from |
Okay, you convinced me. It’s better to have no Can we keep an HTML comment in the “unstripped” source to encourage people to add the |
👍 to adding HTML comment to encourage people to add it. |
Hey guys, I'm new to this and I'm curious, what are the repercussions of leaving But if it's not the best default to have, then I would agree with @mathiasbynens +1 to having HTML comments to educate / encourage people to add it. |
@chenzihui maybe this will help: Specifying the Human Language for Accessibility :) |
This sounds reasonable to me so I guess +1
|
Yeah, the lang att commented somewhere would still work. +1 on setting a good example for others |
It could be possible to set |
@guybedford I think that most of the people that forget to add the
(from: http://www.w3.org/International/tests/tests-html-css/list-language#emptylang)
(from: http://dev.w3.org/html5/spec/global-attributes.html#attr-lang) |
@alrra thanks for the quick response. Apologies for not looking this up further myself first as well. I'm wondering if any of these would actually be an issue. Since one would normally expect the header and meta methods to be made with an understanding of the HTML template. But I suppose it is possible to be using a framework or server that sets these properties automatically with the developer unaware of this, and then they would be inadvertently overriding it in their page template. So yeah it probably does make sense to leave it out entirely. |
@mathiasbynens suggestion for the comment was not taken, any reason? |
@aoberoi, the commit that closed this issue added the following comment: <!-- Consider specifying the language of your content by adding the `lang` attribute to <html> --> Later all comments were removed from the HTML. |
It looks like this nugget was unintentionally not ported to the bundled docs. We could create an issue/patch for this. |
I would add it without the en, so lang="", and then comment that the proper attribute should be added. |
Shocked that you guys removed the tag! What else is missing!!!? atleast place a boilerplate with comments as a secondary option so i can fill in the blanks! This way it is hidden and does not catch any attention. |
It's unfortunate this happened. Having no attribute will most likely lead to many sites missing any kind of language indication. The W3C has the following to say:
If we go this way, then please remove the following items for the exact same reason:
Whatever happened to providing a good "starting point" for people? Isn't that the purpose of the boilerplate? Shouldn't we try to give people a really good template that they can tailor to their own needs? |
necolas argues above: "What I'm concerned about is that this project is resulting in people using it incorrectly. " But leaving it out and missing still remains incorrect! In fact a template is meant to do just the opposite. Otherwise just create a blank .html page!! Its a good thing i had an older copy of the paul irish boiler plate laying around. |
I hate that I will have to pass on the opportunity here to create a "paul irish boiler plate" parody site (Need to create a new Paul Irish? Get started in five minutes with Paul Irish Boilerplate!) |
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². - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ¹ #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 #1542.
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². - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ¹ #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 #1542.
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." - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ref: h5bp/html5-boilerplate#1542.
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.
This project is used for sites that do not contain English-language content. We shouldn't have this attribute in by default, unless there is something I've overlooked.
The text was updated successfully, but these errors were encountered: