Language

How to encode language values

The terms used to encode languages are defined by RFC 3066. They may be:

  1. a two-letter language code taken from ISO 639 part 1
    or
    a three-letter language code taken from ISO 639 part 2
    • When a language in ISO 639 has both a two-letter and three-letter code, use the two-letter code; when it has only a three-letter code, use the three-letter code
  2. optionally
    followed by a two-letter country code taken from ISO 3166
    • If a country code is included then separate the country code from the language code with a hyphen ("-"), for instance en-gb

Some language values, such as the value en, for English, may be qualified by country. This is optional and should only be used for countries where English is the native language. This is mainly for use with English used in the United Kingdom (en-gb) and American English (en-us). Another example is fr-ca for French used in Canada . Do not qualify en by country of origin where English is not the principal language. For instance, do not use en-es for Spanish English. If in doubt use en only.

Terms should be entered in lower case.

References

  1. [ISO 639] http://www.loc.gov/standards/iso639-2/php/English_list.php
  2. [ISO 3166] http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html

Examples

Examples of language values.
Value Language Name
en English
de German
fr French
jp Japanese
iro Iroquoian languages
en-gb English used in the United Kingdom (British English)
en-us English used in the United States of America (American English)
en-ca English used in Canada (Canadian English)
fr-ca French used in Canada (Canadian French)