Forum Moderators: open
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?
<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.
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">