Re: Declaration of the document Language

> Hello all, 
> I have a little question, on my experience the way to declare the lang of a
> docuemnt is to specify it on HTML tag.
> <html lang="fr"> for example.
> Someone ask me if specificy the lang on the a meta tag is valid and
> accessible ? <META NAME="language" CONTENT="FR">
> 
> Can someone help me for this
> 
> Thanks a lot

There are different types of declarations for different reasons. The most 
important is probably the one you describe, the lang attribute (xml:lang in 
XHTML, though lang is still there, albeit deprecated, for backwards 
compatibility).

It's worth noting that this declares the language of a portion of the document. 
While you should have it on the <html> element as you do, you can also have it 
within the document to indicate a change in language, e.g.:

<p lang="en">I was going to go out, but <span lang="fr">Un Cœur en Hiver</span> 
was on television so I just watched that instead.</p>

Another place language can be declared is in the HTTP headers. This is out of 
band from the document itself, and with the HEAD method the document doesn't 
have to actually be downloaded to obtain the language information.

Also you may have software that processes metadata whether it is out of band 
(say in a seperate RDF/XML) file, or embedded into the document. One way of 
embedding would be with embedded RDF/XML, though no way of doing that is 
completely issue-free or even standards-compliant yet.
Another way of embedding is to use Dublin Core in HTML. A way of doing that 
which was suggested was:
<head profile="http://purl.org/dc/elements/1.1/">
  <meta name="language" content="fr" scheme="RFC 3066" />
...

But this would only let you use one metadata schema per document, which is 
clearly limiting. Hence the following was used in RFC 2731:

<link rel = "schema.DC"
  href = "http://purl.org/DC/elements/1.1/" />
  <meta name="language" content="fr" scheme="RFC 3066" />

That way there is nothing to stop one from defining schema.XX to be something 
else and using it in the same document as Dublin Core. This is comparable to 
the way that XML namespaces work, but it is important not to confuse the two 
(especially since there are other systems that use XML namespaces to identify 
Dublin Core elements, and they are quite different).

--
Jon Hanna                   | Toys and books
<http://www.hackcraft.net/> | for hospitals:
                            | <http://santa.boards.ie/>

Received on Thursday, 4 December 2003 12:17:04 UTC