Declaring Languages in HTML and XHTML

There is a good summary of techniques for specifying the language of content at The Web Standards Project: Best Practices for Declaring Languages in HTML and XHTML.

Developers who never come in contact with other languages than English may not have much need for this, but for the rest of us a summary like this is very helpful.

I'd like to add one more guideline: Do not specify the language of a document in the DOCTYPE declaration. I have seen people do that too often. The language code in the DOCTYPE declaration declares the language of the document type definition that the DOCTYPE URI points to. For the W3C DTDs, that language is always English, so don't go changing that //EN.

Posted on September 11, 2005 in (X)HTML, Quicklinks