http-equiv=content-language alternative - the way of specifying document language

11,210

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.

Share:
11,210

Related videos on Youtube

tugberk
Author by

tugberk

Updated on September 18, 2022

Comments

  • tugberk
    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
    tugberk over 12 years
    thanks! should we always use Two Letter ISO Language Name? or can we use something like this: en-US?
  • tugberk
    tugberk over 12 years
    It is defined here in details: w3.org/TR/html4/struct/dirlang.html
  • John Conde
    John Conde over 12 years
    The 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
    tugberk over 12 years
    The information here should be correct, right? w3.org/TR/html4/struct/dirlang.html#langcodes
  • John Conde
    John Conde over 12 years
    Only if you're using HTML4. HTML5's specs are different.
  • tugberk
    tugberk over 12 years
    that's right and HTML5 specs are not completed yet.
  • paulmorriss
    paulmorriss almost 12 years
    What do you mean "what is this"?