Internet Engineering Task Force (IETF) language tags are defined by
IETF BCP 47, which is currently composed by the normative RFC 5646
(https://tools.ietf.org/html/rfc5646) and RFC 4647
(https://tools.ietf.org/html/rfc4646), along with the normative
content of the IANA Language Subtag Registry regulated by these RFCs.
These tags are used in a number of modern computing standards.
Each language tag is composed of one or more “subtags”
separated by hyphens. Normal language tags have the following
subtags:
a language subtag (optionally, with language extension
subtags),
an optional script subtag,
an optional region subtag,
optional variant subtags,
optional extension subtags,
an optional private use subtag.
Language subtags are mainly derived from ISO 639-1 and ISO 639-2,
script subtags from ISO 15924, and region subtags from ISO 3166-1
alpha-2 and UN M.49, see package ISOcodes for more information
about these standards. Variant subtags are not derived from any
standard. The Language Subtag Registry
(https://www.iana.org/assignments/language-subtag-registry),
maintained by the Internet Assigned Numbers Authority (IANA), lists
the current valid public subtags, as well as the so-called
“grandfathered” language tags.
See https://en.wikipedia.org/wiki/IETF_language_tag for more
information.