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

RE: implementing the lang attribute

From: Richard Ishida <ishida@w3.org>
Date: Wed, 30 Jul 2003 19:01:29 +0100
To: "'Charles McCathieNevile'" <charles@sidar.org>, "'Melinda'" <geekchic@geekchic.com>
Cc: <w3c-wai-ig@w3.org>
Message-ID: <003401c356c4$9a90b760$6401a8c0@w3c40upc3ma3j2>

Hello Melinda, Charles,

The use of language codes is described by RFC3066 (which obsoletes
RFC1766).  See the erratum E41 for the XML spec
http://www.w3.org/XML/xml-V10-2e-errata

I have requested a similar erratum for the HTML spec, and I believe it
is close to happening.  You should use RFC3066 anyway, as it is
backwards compatible with RFC1766.

RFC3066 says you should use the 2-letter codes where available - ensures
better interoperability.  So English should be 'en' not 'eng'.  3-letter
codes can be used where there is no 2-letter code.

The last time I looked (and I don't suspect it has changed) there was no
code for Traditional Chinese or Simplified Chinese (note that these are
actually scripts rather than languages).  Common practise in the
localisation industry seems to be zh-TW for Traditional and zh-CN for
Simplified (actually meaning taiwanese chinese and (mainland) china
chinese, respectively).

For South America I don't know the answer, although I must say I've
wanted to know for some time.

In terms of online references, you may find
http://www.w3.org/International/O-HTML-tags.html useful.

It's great to see that you are adding the lang tag to the html tag.
Note also (I had a discussion with WCAG about this just last week) that
if you are writing XHTML (which is a good idea, by the way) you should
also have a xml:lang as well as a lang attribute.  That is not yet in
the WCAG guidelines, but hopefully will be soon.

I hope this helps.  
Best, 

Richard.

============
Richard Ishida
W3C

tel: +44 1753 480 292
http://www.w3.org/People/Ishida/ 
http://www.w3.org/International/ 
http://www.w3.org/International/geo/ 

See the W3C Internationalization FAQ page
http://www.w3.org/International/questions.html



> -----Original Message-----
> From: Charles McCathieNevile [mailto:charles@sidar.org] 
> Sent: 30 July 2003 18:21
> To: Melinda
> Cc: w3c-wai-ig@w3.org
> Subject: Re: implementing the lang attribute
> 
> 
> This is really an internationalisation question, but since it is 
> required for accessibility it makes sense to look for answers here.
> 
> three letter codes: According to XML 1.0 second edition you must use 
> the two-letter codes -- 
> http://www.w3.org/TR/REC-xml#sec-lang-tag - and 
> although it seems to foreshadow moving to 3-letter codes that change 
> doesn't appear to have been made in the draft of XML 1.1. Same thing 
> goes for HTML -- 
> http://www.w3.org/TR/html4/struct/dirlang.html#langcodes
> 
> Dialects: According to that bit in the HTML spec, you can identify 
> languages as spoken in a particular country. Since simplified or 
> traditional chinese are the common forms in different countries you 
> might be able to use that. Latin American Spanish is not, in 
> any case, 
> a single dialect - so you may as well identify the source country...
> 
> just  my 2 bits worth - there are people more expert at 
> internationalisation than me
> 
> Chaals
> 
> On Wednesday, Jul 30, 2003, at 18:34 Europe/Zurich, Melinda wrote:
> 
> >
> > Hi, all.
> >
> > The company I work for is currently trying to do due diligence in
> > correctly implementing the "lang" attribute on the <HTML> tag as 
> > recommended by WCAG guidelines.  Simple as it may seem, we have run 
> > into a few questions for which we are not able to find 
> ready sources 
> > of answers.
> >
> > 1) we needed to standardize on one ISO standard for all our language
> > information in our web publishing systems company wide. Since the 
> > 3-letter ISO 639 code is more complete, we have chosen that.  The 
> > references on the W3C guidelines show all the examples 
> using 2 letter 
> > codes.  Will the 3-letter codes also work?  e.g., lang="eng-us" or 
> > lang="fre"
> >
> > 2) There are certain dialects for which we can not find a 
> satisfactory
> > representation in W3C documentation.  Are there standard ISO / W3C 
> > representations for these languages? if so, what are they?  The 
> > languages we are struggling with are:
> >
> > Traditional Chinese
> > Simplified Chinese
> > Latin American Spanish
> >
> > Any answers you could provide would be appreciated. Also, 
> if there is
> > an online reference that spells these things out I would love to 
> > bookmark it and share it with my colleagues.
> >
> > Much obliged,
> > Melinda
> >
> >
> --
> Charles McCathieNevile                          Fundación Sidar
> charles@sidar.org                                http://www.sidar.org
> 
Received on Wednesday, 30 July 2003 14:02:15 GMT

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