Language Values
The value of the lang
and xml:lang
attributes is a language tag as
defined in “Tags for the Identification of Languages” (RFC
3066 ). Language tags consist of a primary subtag that
identifies the language according to a two-or three-letter language code
(according to the ISO 639 standard ), for example, fr
for
French or no
for Norwegian. When a
language has both a two-and three-letter code, the two-letter code
should be used.
The complete list of ISO 639 language codes is available at the Library of Congress web site at www.loc.gov/standards/iso639-2/langcodes.html. The more common two-letter codes are provided in Table 6-2 at the end of this section.
A language tag may also contain an optional subtag that further qualifies the language by country, dialect, or script, as shown in these examples.
-
en-GB
English as spoken in Great Britain
-
en-scouse
English with a scouse (Liverpool) dialect
-
bs-Cyrl
Bosnian with Cyrillic script (rather than Latin script,
bs-Latn
)
Codes for country names are provided by the standard ISO 3166 and are available at http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html. Dialect and script language tags are registered with the IANA (Internet Assigned Numbers Authority) and are available at http://www.iana.org/assignments/language-tags.
Table 6-2. Two-letter codes of language names
Language |
Code |
Language |
Code |
Language |
Code |
---|---|---|---|---|---|
Afar |
|
Armenian |
|
Oriya |
|
Abkhazian |
|
Herero |
|
Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.