Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (9 sloc) 1020 Bytes

An IETF language code (such as "en-US") is a combination of a primary language subtag such as "en" (which is an ISO 639 language code), and optionally a region subtag such as "US" (which is an ISO 3166-1 country code). The region subtag is only added when it is needed to make a distinction between the same language as spoken in different regions (en-US vs en-GB). So for a language such as Japanese, the tag would be simply "jp" instead of "jp-JP", since that language is only spoken predominantly in one country. There are additional optional subtags, such as the script to use for non-roman alphabets.

Info:

http://en.wikipedia.org/wiki/IETF_language_tag
http://www.w3.org/International/articles/language-tags/
http://www.w3.org/International/questions/qa-choosing-language-tags
http://www.rfc-editor.org/rfc/bcp/bcp47.txt

Reference data:

http://www.iana.org/assignments/language-subtag-registry
http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_txt.htm