RFC 1766

Tags for the Identification of Languages

๐Ÿ“… published March 1995, from ietf

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