http-equiv=content-language alternative - the way of specifying document language
Solution 1
It belongs ion the <html>
tag:
<html lang="en">
Solution 2
The full answer to the question is answered by the W3C here: http://www.w3.org/International/questions/qa-http-and-lang.en
@John Conde is correct that it should be included as part of the <html>
tag, but there's also the important consideration of ensuring that it's included as part of the HTTP Headers.
Most Meta elements are redundant replacements or over-rides for information that should be sent as part of the HTTP request and response.
Solution 3
<meta http-equiv="content-language" content="ll-cc">
what is this
John Conde is correct that it should be included as part of the tag, but there's also the important consideration of ensuring that it's included as part of the HTTP Headers.
Most Meta elements are redundant replacements or over-rides for information that should be sent as part of the HTTP request and response.
Related videos on Youtube
tugberk
Updated on September 18, 2022Comments
-
tugberk almost 2 years
Lots of web sites uses following meta tag to specify the default language of the document:
<meta http-equiv="content-language" content="es-ES">
When I go to W3C site and read about HTML language mark up I get this:
Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.
What is the way of specifying document language now?
-
tugberk over 12 yearsthanks! should we always use Two Letter ISO Language Name? or can we use something like this:
en-US
? -
tugberk over 12 yearsIt is defined here in details: w3.org/TR/html4/struct/dirlang.html
-
John Conde over 12 yearsThe spec document for what is acceptable is quite long and I haven't read it, but based on the examples I have seen it appears that the two letter ISO language is the only acceptable value. If I'm wrong hopefully someone will point it out.
-
tugberk over 12 yearsThe information here should be correct, right? w3.org/TR/html4/struct/dirlang.html#langcodes
-
John Conde over 12 yearsOnly if you're using HTML4. HTML5's specs are different.
-
tugberk over 12 yearsthat's right and HTML5 specs are not completed yet.
-
paulmorriss almost 12 yearsWhat do you mean "what is this"?