Forum Moderators: open

Message Too Old, No Replies

Meta "Content Language" Tag Usage.

Which meta tag for Content Language is correct?

         

g1smd

7:34 pm on Apr 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Looking back through some old pages I notice that I used to use:
<meta name="Language" content="en-gb">

I see that for the last few years I have been using:
<meta http-equiv="Content-Language" content="en-gb">

Are any of these syntactially correct? Are they equivalent or not? Is there any advantage of using one or the other? Is there any sort of list of which spiders and browsers support these, or any other browser specific or W3C standard information about this?

.

I have seen other pages using things like:
<meta name="Language" content="english">
<meta name="Content-Language" content="english">
<meta name="Language" content="english (us)">
Are any of those valid?

Of the en-gb part in the first examples, the first two letters come from the code list in ISO 639 and the last two letters come from the code list in ISO 3166.

See also ISO 4217 for codes for representing currency, and then ISO 8601 for formats for date and time.

Any other comments or information that anyone else feels like sharing?

universalis

7:52 pm on Apr 9, 2003 (gmt 0)

10+ Year Member



The meta tag should be as follows:

<meta http-equiv="Content-Language" content="fr-ca">

or for an XHTML document:

<meta http-equiv="Content-Language" content="fr-ca" />

In this example, fr=French; ca=Canada. You don't have to specify the second part - you can use "en" for English, "fr" for French, etc.

Of course, if you have control over your own server, you can set a default content language, for example in httpd.conf (Apache), meaning you can leave out the meta tag completely.

Mohamed_E

9:10 pm on Apr 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For a long time I have been specifying the language using:

<html lang="en">

Is the http-equiv syntax preferred?

universalis

3:04 pm on Apr 10, 2003 (gmt 0)

10+ Year Member



<html lang="en"> is recommended by the W3C for HTML, but my understanding is that it is not widely supported in browsers. I use it too, but I prefer the belt and braces approach so I use the meta tag as well.

Of course, in XHTML you always specify the language in the <html> tag:

XHTML 1.0:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

XHTML 1.1:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

g1smd

8:59 pm on Apr 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks for the useful replies so far. I thought that I was right in my current usage. Thanks for confirming it.

Has anyone else got any other thoughts on this topic?