W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2003

Re: Declaration of the document Language

From: <jon@hackcraft.net>
Date: Thu, 4 Dec 2003 17:16:59 +0000
Message-ID: <1070558219.3fcf6c0b04e0f@82.195.128.192>
To: yoan SIMONIAN <yoan.simonian@snv.jussieu.fr>
Cc: "w3c-wai-ig@w3.org" <w3c-wai-ig@w3.org>

> 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:13 GMT