RFC 1766
Tags for the Identification of Languages
Tags for the Identification of Languages ๐
RFC 1766 ๐ is titled Tags for the Identification of Languages. It came from the Network Working Group and was written by H. Alvestrand from UNINETT. It's on the Standards Track and is dated March 1995 ๐ธ. Its header doesn't list anything it obsoletes or updates, so there's no drama there ๐ .
Status of this Memo โจ
This doc is an Internet standards track protocol for the Internet community, and it's literally asking for discussion and suggestions for improvements ๐ซถ. For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited ๐ฆ.
Abstract ๐
Okay, so the abstract is basically this: the doc defines a language tag ๐ท๏ธ for saying which language an information object is in. It also defines a Content-language: header ๐ for things that have RFC-822-like headers, like MIME body parts or Web documents. And it adds a new parameter to the Multipart/Alternative type to help you use that Content-Language: header ๐ .
1. Introduction ๐ง
There are sooo many languages spoken by human beings in this world ๐.
A huge number of those people would way rather get information in a language they actually understand ๐ซถ.
In some situations you can have information in more than one language. Or you could give people tools that help them understand a language, like dictionaries ๐.
Any of that needs a prerequisite: a way to label the content with an identifier for the language it's written in ๐ท๏ธ.
Fun fact, we only solve problems we actually understand ๐. So this doc specifies an identifier mechanism, plus one possible use for it ๐ฆ.
2. The Language tag ๐
A language tag is made of 1 or more parts: a primary language tag, and a (possibly empty) series of subtags ๐.
Here's the syntax in RFC-822 EBNF:
Language-Tag = Primary-tag *( "-" Subtag )
Primary-tag = 1*8ALPHA
Subtag = 1*8ALPHA
Whitespace is not allowed within the tag ๐ .
All tags are to be treated as case insensitive. There are conventions for capitalizing some of them, but those should not be taken to carry meaning ๐.
The namespace of language tags is administered by the IANA according to the rules in section 5 of this document ๐.
These registrations are predefined:
In the primary language tag:
- All 2-letter tags are interpreted according to ISO standard 639, "Code for the representation of names of languages" [ISO 639] ๐ท.
- The value "i" is reserved for IANA-defined registrations.
- The value "x" is reserved for private use. Subtags of "x" will not be registered by the IANA ๐.
- Other values cannot be assigned except by updating this standard ๐ซ.
The reason for reserving all the other tags is to stay open to new revisions of ISO 639. Using "i" and "x" is the bare minimum we can do here to extend the mechanism and meet our requirements ๐งฉ.
In the first subtag:
- All 2-letter codes are interpreted as ISO 3166 alpha-2 country codes, denoting the area in which the language is used ๐บ๏ธ.
- Codes of 3 to 8 letters may be registered with the IANA by anyone who feels a need for it, according to the rules in chapter 5 of this document ๐ .
The information in the subtag may, for instance, be:
- Country identification, such as en-US (this usage is described in ISO 639) ๐บ๐ธ.
- Dialect or variant information, such as no-nynorsk or en-cockney ๐ฉ.
- Languages not listed in ISO 639 that are not variants of any listed language, which can be registered with the i- prefix, such as i-cherokee ๐ฟ.
- Script variations, such as az-arabic and az-cyrillic โ๏ธ.
In the second and subsequent subtag, any value can be registered ๐.
NOTE: The ISO 639/ISO 3166 convention is that language names are written in lower case, while country codes are written in upper case. This convention is recommended, but not enforced. The tags are case insensitive anyway ๐.
NOTE: ISO 639 defines a registration authority for additions to and changes in the list of languages in ISO 639. This authority is:
International Information Centre for Terminology (Infoterm)
P.O. Box 130
A-1021 Wien
Austria
Phone: +43 1 26 75 35 Ext. 312
Fax: +43 1 216 32 72
The following codes were added in 1989, and nothing later: ug (Uigur), iu (Inuktitut, also called Eskimo), za (Zhuang), he (Hebrew, replacing iw), yi (Yiddish, replacing ji), and id (Indonesian, replacing in) ๐๏ธ.
NOTE: The registration agency for ISO 3166 (country codes) is:
ISO 3166 Maintenance Agency Secretariat
c/o DIN Deutches Institut fuer Normung
Burggrafenstrasse 6
Postfach 1107
D-10787 Berlin
Germany
Phone: +49 30 26 01 320
Fax: +49 30 26 01 231
The country codes AA, QM-QZ, XA-XZ and ZZ are reserved by ISO 3166 as user-assigned codes ๐ ๏ธ.
2.1. Meaning of the language tag ๐ฆ
A language tag always defines a language as spoken (or written) by human beings, for communicating information to other human beings. Computer languages are explicitly excluded ๐ค๐ซ.
There is no guaranteed relationship between languages whose tags start out with the same series of subtags. Especially, they are NOT guaranteed to be mutually comprehensible, although this will sometimes be the case ๐ฌ.
Applications should always treat language tags as a single token. The split between the main tag and the subtags is an administrative mechanism, not a navigation aid ๐งญ.
The relationship between the tag and the information it relates to is defined by the standard describing the context in which it appears. So this section can only give possible examples of how it's used ๐ก.
- For a single information object, it should be taken as the set of languages required for a complete comprehension of the complete object. Example: simple text ๐.
- For an aggregation of information objects, it should be taken as the set of languages used inside the components of that aggregation. Examples: document stores and libraries ๐.
- For information objects whose purpose in life is providing alternatives, it should be regarded as a hint that the material inside is provided in several languages. One has to inspect each of the alternatives to find its language or languages. In this case, multiple languages need not mean that one needs to be multilingual to get complete understanding of the document. Example: MIME multipart/alternative ๐ฏ.
- It would be possible to define (for instance) an SGML DTD that defines a
<LANG xx>tag for indicating that following or contained text is written in this language, such that one could write<LANG FR>C'est la vie</LANG>. The Norwegian-speaking user could then access a French-Norwegian dictionary to find out what the quote meant ๐ซ๐ทโจ.
3. The Content-language header ๐
The Language header is intended for use in the case where one wants to indicate the language(s) of something that has RFC-822-like headers, like MIME body parts or Web documents ๐.
Its RFC-822 EBNF looks like this:
Language-Header = "Content-Language" ":" 1#Language-tag
The Language-Header is allowed to list several languages in a comma-separated list. Main character energy ๐.
Whitespace is allowed, which also means you can put parenthesized comments anywhere in the language sequence ๐.
3.1. Examples of Content-language values ๐ญ
NOTE: NONE of the subtags shown in this document have actually been assigned. They're only used for illustration purposes ๐.
A Norwegian official document, with parallel text in both official versions of Norwegian. Both versions are readable by all Norwegians ๐ณ๐ด:
Content-Type: multipart/alternative;
differences=content-language
Content-Language: no-nynorsk, no-bokmaal
A voice recording from the London docks ๐๏ธ:
Content-type: audio/basic
Content-Language: en-cockney
A document in Sami. Sami doesn't have an ISO 639 code, and it's spoken in several countries, with about half the speakers in Norway. It has six different, mutually incomprehensible dialects ๐:
Content-type: text/plain; charset=iso-8859-10
Content-Language: i-sami-no (North Sami)
An English-French dictionary ๐:
Content-type: application/dictionary
Content-Language: en, fr (This is a dictionary)
An official EC document, in a few of its official languages ๐ช๐บ:
Content-type: multipart/alternative
Content-Language: en, fr, de, da, el, it
An excerpt from Star Trek ๐:
Content-type: video/mpeg
Content-Language: x-klingon
4.1. The differences parameter to multipart/alternative ๐ธ
okay so, as defined in RFC 1541, Multipart/Alternative only has one parameter: boundary. ๐
the usual move is sending the same message in more than one format, like PostScript and ASCII (f.ex. PostScript and ASCII). ๐
ngl, slapping language tags on each alternative is not going to make every MIME UA pick the most sensible body part by default. ๐ so they made a new parameter! โจ it lets MIME readers handle language differences in a sensible way. ๐ซถ
Name: Differences
Value: One or more of
Content-Type
Content-Language
more values can be registered with IANA, but it must be the name of a header that has a definition in a published RFC. ๐ if the parameter isn't there, Differences=Content-Type is assumed. ๐
the vibe is that the MIME reader can peek at these headers on each message component and make a smart choice about what to show the user, based on what the user prefers and what their setup can handle. ๐ง ๐
(the reason for registering the fields used here with IANA is to keep a list of usages a mail UA might expect to see, not to reject usages. ๐ฆ)
(NOTE: The MIME specification [RFC 1521], section 7.2, says headers that don't begin with "Content-" are generally ignored in body parts. People defining a header for use with "differences=" should take note of this. ๐)
how the reader actually decides which body part to show is outside the scope of this document. ๐
MIME EXAMPLE: ๐
Content-Type: multipart/alternative; differences=Content-Language;
boundary="limit"
Content-Language: en, fr, de
--limit
Content-Language: fr
Le renard brun et agile saute par dessus le chien paresseux
--limit
Content-Language: de
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-encoding: quoted-printable
Der schnelle braune Fuchs h=FCpft =FCber den faulen Hund
--limit
Content-Language: en
The quick brown fox jumps over the lazy dog
--limit--
when you're composing a message, the order of the parts is kinda arbitrary. ๐คทโโ๏ธ BUT non-MIME mail readers show the first body part first, so that one should probably be the language most of the recipients understand. ๐
5. IANA registration procedure for language tags ๐๏ธ
okay this one's important: any language tag must start with an existing tag, and extend it. ๐
anyone who wants to use a language tag that isn't defined by ISO or IANA should use this registration form. ๐
----------------------------------------------------------------------
LANGUAGE TAG REGISTRATION FORM
Name of requester :
E-mail address of requester:
Tag to be registered :
English name of language :
Native name of language (transcribed into ASCII):
Reference to published description of the language (book or article):
----------------------------------------------------------------------
send the form to <ietf-types@uninett.no> for a 2-week review period before you submit it to IANA. ๐ (it's an open list, and if you want to be added, email <ietf-types-request@uninett.no>. ๐โโ๏ธ)
once the two weeks are up, the language tag reviewer (appointed by the IETF Applications Area Director) either forwards the request to IANA@ISI.EDU, or rejects it because of significant objections raised on the list. โ๏ธ
if the reviewer makes a call you disagree with, you can appeal it to the IESG. ๐ โโ๏ธ
all the registered forms are online at ftp://ftp.isi.edu/in-notes/iana/assignments/languages/ ๐บ๏ธ
6. Security Considerations ๐
ok, real talk: security issues are not discussed in this memo. ๐ nothing in here covers them, so don't go looking for it here. ๐
7. Character set considerations ๐ค
codes can always be written using the US-ASCII character repertoire (a-z), which pretty much every character set has. ๐ธ
the memo doesn't address deciding how to render a character set based on the language tag. ๐ซ the thing is, it's thought to be impossible to make that call correctly in every case, unless there are ways to switch languages in the middle of a text. ๐ญ for example, a rendering engine that picks a font based on Japanese or Chinese will fail when it hits a mixed Japanese-Chinese text. ๐ต
8. Acknowledgements ๐ซถ
this document got better thanks to innumberable rounds of review and comments in lots of IETF fora and Internet working groups. ๐ so any list of contributors is bound to be incomplete. ๐ฅฒ please think of the list below as just a selection of the people who helped make this document what it is today. โจ
in alphabetical order:
Tim Berners-Lee, Nathaniel Borenstein, Jim Conklin, Dave Crocker, Ned Freed, Tim Goodwin, Olle Jarnefors, John Klensin, Keith Moore, Masataka Ohta, Keld Jorn Simonsen, Rhys Weatherley, and many, many others. ๐
9. Author's Address ๐ฎ
Harald Tveit Alvestrand
UNINETT
Pb. 6883 Elgeseter
N-7002 TRONDHEIM
NORWAY
EMail: Harald.T.Alvestrand@uninett.no
Phone: +47 73 59 70 94
10. References ๐
[ISO 639] ISO 639:1988 (E/F) - Code for the representation of names of languages - The International Organization for Standardization, 1st edition, 1988 17 pages Prepared by ISO/TC 37 - Terminology (principles and coordination).
[ISO 3166] ISO 3166:1988 (E/F) - Codes for the representation of names of countries - The International Organization for Standardization, 3rd edition, 1988-08-15.
[RFC 1521] Borenstein, N., and N. Freed, "MIME Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1521, Bellcore, Innosoft, September 1993.
[RFC 1327] Kille, S., "Mapping between X.400(1988) / ISO 10021 and RFC 822", RFC 1327, University College London, May 1992. ๐
๐ฆ where this page comes from
- ietf: rfc1766 1995-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms