Accesskey n skips to in-page navigation. Skip to the content start.

s_gotoW3cHome Internationalization
 

Two-letter or three-letter language codes

Question

Should I use two-letter or three-letter ISO language codes in language tags?

Background

The Internet and the Web uses language tags to indicate the natural language of text in protocols and formats, such as HTML, XHTML, XML, HTTP, and others. In the past the language tag values were defined by RFC 3066 Tags for the Identification of Languages (and its predecessor RFC 1766) and began with either a ISO 639-1 two-letter language code or ISO 639-2 three-letter code. For some languages there were both two-letter and three-letter alternatives in the ISO codes. (And for some languages there were even two three-letter alternatives to choose from.)

People were sometimes confused about which ISO code they should use in a language tag.

Answer

The good news is that you don't need to worry about this question any more!

In 2006 the IETF published a new specification describing how to create language tags, RFC 4646. This no longer refers you to the ISO code lists. Instead you should look for the appropriate subtags in the new IANA Language Subtag Registry. This registry contains only one subtag per language, so there is no longer any ambiguity.

Although you now need to look in the IANA Language Subtag Registry rather than the ISO code lists, the language tags you have been using so far don't need to change (as long as you followed the 'shortest code' rule). This is just a change in how you access them.

The IANA Language Subtag Registry still uses, and keeps up to date with, codes from the ISO standards, but the registry maintainers take care of the 2- or 3-letter rule.

For more information about how to use the new language tag syntax and the registry, see the article Language Tags in HTML and XML.

Tell us what you think (English).

Subscribe to an RSS feed.

New resources

Home page news

Further reading

Author: Martin Dürst, W3C. Modified by: Richard Ishida, W3C.

Valid XHTML 1.0!
Valid CSS!
Encoded in UTF-8!

Content first published 2003-08-14. Last substantive update 2006-09-23 12:34 GMT. This version 2006-11-27 08:07 GMT

For the history of document changes, search for qa-lang-2or3 in the i18n blog.