RFC 4646

Tags for Identifying Languages

๐Ÿ“… published September 2006, from ietf

Tags for Identifying Languages ๐ŸŒธ

Okay bestie, the title block first, because it's giving legit paperwork energy ๐Ÿ“‹. RFC 4646 is a Best Current Practice (BCP 47) from September 2006. A. Phillips (Yahoo! Inc.) and M. Davis (Google) are the editors, both marked as Ed. ๐Ÿ’œ This doc obsoletes RFC 3066, so 3066 is officially retired and this one takes its place. It doesn't list anything it updates.

Status of This Memo

This document is an Internet Best Current Practices spec for the Internet Community ๐Ÿซถ. It's also asking everyone to chat about it and suggest improvements, so the discourse is welcome. Distribution of this memo is unlimited, so share it freely โœจ.

Copyright (C) The Internet Society (2005). ๐ŸŽ€

Abstract

Okay, the abstract is the whole vibe check โœจ. This doc explains the structure, content, construction, and meaning of language tags, which are used when you want to show which language an information object is in ๐ŸŒˆ. It also covers how to register new values for language tags, and how to make your own user-defined extensions for private swapping. This doc, together with RFC 4647, replaces RFC 3066, which had already replaced RFC 1766. Iconic lineage ๐Ÿ‘‘.

Table of Contents

   1. Introduction ....................................................3
   2. The Language Tag ................................................4
      2.1. Syntax .....................................................4
      2.2. Language Subtag Sources and Interpretation .................7
           2.2.1. Primary Language Subtag .............................8
           2.2.2. Extended Language Subtags ..........................10
           2.2.3. Script Subtag ......................................11
           2.2.4. Region Subtag ......................................11
           2.2.5. Variant Subtags ....................................13
           2.2.6. Extension Subtags ..................................14
           2.2.7. Private Use Subtags ................................16
           2.2.8. Preexisting RFC 3066 Registrations .................16
           2.2.9. Classes of Conformance .............................17
   3. Registry Format and Maintenance ................................18
      3.1. Format of the IANA Language Subtag Registry ...............18
      3.2. Language Subtag Reviewer ..................................24
      3.3. Maintenance of the Registry ...............................24
      3.4. Stability of IANA Registry Entries ........................25
      3.5. Registration Procedure for Subtags ........................29
      3.6. Possibilities for Registration ............................32
      3.7. Extensions and Extensions Registry ........................34
      3.8. Initialization of the Registries ..........................37
   4. Formation and Processing of Language Tags ......................38
      4.1. Choice of Language Tag ....................................38
      4.2. Meaning of the Language Tag ...............................40
      4.3. Length Considerations .....................................41
           4.3.1. Working with Limited Buffer Sizes ..................42
           4.3.2. Truncation of Language Tags ........................43
      4.4. Canonicalization of Language Tags .........................44
      4.5. Considerations for Private Use Subtags ....................45
   5. IANA Considerations ............................................46
      5.1. Language Subtag Registry ..................................46
      5.2. Extensions Registry .......................................47
   6. Security Considerations ........................................48
   7. Character Set Considerations ...................................48
   8. Changes from RFC 3066 ..........................................49
   9. References .....................................................52
      9.1. Normative References ......................................52
      9.2. Informative References ....................................53
   Appendix A. Acknowledgements ......................................55
   Appendix B. Examples of Language Tags (Informative) ...............56

1. Introduction ๐Ÿฆ‹

Humans have spoken a whole bunch of languages, past and present ๐ŸŒ. There are lots of reasons you'd want to know which language is being used when info is presented or requested, and honestly it's a lot.

Your language preferences often need to be identified so the right processing can happen. Like, the language settings in your browser can pick which web pages you see ๐Ÿ’ป. Language preferences can also pick which tools (like dictionaries) help you process or understand content in different languages ๐Ÿ“š.

Knowing the exact language of some content can also be super useful, or even required, for certain kinds of processing ๐Ÿง . Think spell-checking, computer-synthesized speech, Braille transcription, or high-quality print renderings. Essential stuff, bestie ๐Ÿ’….

One way to say what language is being used is to label the content with an identifier, aka a "tag" ๐Ÿท๏ธ. Those tags can be used to set user preferences when picking content, or to label other attributes of the content and its related resources.

Tags can also show extra language details. For example, saying which dialect, writing system, or orthography a document uses can help someone get info in a form they can actually read ๐Ÿซ . It can also matter a lot for how the content gets processed or rendered into the right form or style โœจ.

This doc specifies one particular identifier mechanism, the language tag, plus a registration function for the values used to build tags ๐ŸŽ€. It also defines a way to make private use values and handle future extensions ๐Ÿ”ฎ.

This doc, together with [RFC4647], replaces [RFC3066], which replaced [RFC1766]. For a list of changes in this doc, check out Section 8 ๐Ÿ“.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ๐Ÿค“.

2. The Language Tag โœจ

Language tags help identify languages, whether they're spoken, written, signed, or signaled some other way, so people can communicate ๐Ÿ—ฃ๏ธ. That includes constructed and artificial languages, but it leaves out languages that aren't mainly meant for humans to talk to, like programming languages ๐Ÿ’ป. Sorry, Python ๐Ÿ™ˆ.

2.1. Syntax ๐Ÿ’œ

A language tag is made of one or more parts called "subtags" ๐Ÿงฉ. Each subtag is a run of alphanumeric characters. Subtags are split up and separated by a hyphen ("-", ABNF [RFC4234] %x2D). A language tag has a "primary language" subtag, followed by a (possibly empty) series of subsequent subtags. Each one refines or narrows the range of languages the whole tag points to, kinda like zooming in on a map ๐Ÿ”.

Usually, you can tell each type of subtag apart by its length, its position in the tag, and its content, so subtags can be recognized just by those features ๐ŸŽฏ. The only exception is a fixed list of grandfathered tags registered under RFC 3066 [RFC3066]. This means you can build a parser that pulls out and assigns some semantic info to the subtags, even when it doesn't recognize the specific values ๐Ÿง . So a parser doesn't need an up-to-date copy of the subtag registry (or any copy at all) to do most searching and matching ๐Ÿ™Œ.

The syntax of the language tag in ABNF [RFC4234] is:

   Language-Tag  = langtag
                 / privateuse             ; private use tag
                 / grandfathered          ; grandfathered registrations

   langtag       = (language
                    ["-" script]
                    ["-" region]
                    *("-" variant)
                    *("-" extension)
                    ["-" privateuse])

   language      = (2*3ALPHA [ extlang ]) ; shortest ISO 639 code
                 / 4ALPHA                 ; reserved for future use
                 / 5*8ALPHA               ; registered language subtag

   extlang       = *3("-" 3ALPHA)         ; reserved for future use

   script        = 4ALPHA                 ; ISO 15924 code

   region        = 2ALPHA                 ; ISO 3166 code
                 / 3DIGIT                 ; UN M.49 code

   variant       = 5*8alphanum            ; registered variants
                 / (DIGIT 3alphanum)

   extension     = singleton 1*("-" (2*8alphanum))

   singleton     = %x41-57 / %x59-5A / %x61-77 / %x79-7A / DIGIT
                 ; "a"-"w" / "y"-"z" / "A"-"W" / "Y"-"Z" / "0"-"9"
                 ; Single letters: x/X is reserved for private use

   privateuse    = ("x"/"X") 1*("-" (1*8alphanum))

   grandfathered = 1*3ALPHA 1*2("-" (2*8alphanum))
                   ; grandfathered registration
                   ; Note: i is the only singleton
                   ; that starts a grandfathered tag

   alphanum      = (ALPHA / DIGIT)       ; letters and numbers

                        Figure 1: Language Tag ABNF

Note: There is a subtlety in the ABNF for 'variant': variants starting with a digit MAY be four characters long, while those starting with a letter MUST be at least five characters long. ๐Ÿง Easy to miss, so keep an eye out, bestie ๐Ÿ‘€.

All subtags have a maximum length of eight characters, and whitespace is not allowed in a language tag ๐Ÿšซ. For examples of language tags, see Appendix B ๐ŸŒˆ.

Note that although [RFC4234] talks about octets, the language tags in this doc are sequences of characters from the US-ASCII [ISO646] repertoire ๐Ÿ”ค. Language tags MAY be used in documents and applications that use other encodings, so long as those encodings cover the US-ASCII repertoire. For example, an XML document that uses the UTF-16LE [RFC2781] encoding of [Unicode] is totally fine ๐Ÿ’–.

The tags and their subtags, including private use and extensions, are to be treated as case insensitive. There are conventions for capitalizing some subtags, but these MUST NOT be taken to carry meaning ๐Ÿ™…โ€โ™€๏ธ. The vibe is: capitalization is just styling, not semantics โœจ.

For example:

  • [ISO639-1] recommends that language codes be written in lowercase ('mn' Mongolian) ๐Ÿ‡ฒ๐Ÿ‡ณ.
  • [ISO3166-1] recommends that country codes be capitalized ('MN' Mongolia) ๐Ÿ”๏ธ.
  • [ISO15924] recommends that script codes use lowercase with the initial letter capitalized ('Cyrl' Cyrillic) โœ๏ธ.

However, in the tags this doc defines, the uppercase US-ASCII letters 'A' through 'Z' are considered equivalent and mapped directly to their US-ASCII lowercase equivalents 'a' through 'z'. So the tag "mn-Cyrl-MN" is not distinct from "MN-cYRL-mn" or "mN-cYrL-Mn" (or any other combination), and each of these variations means the same thing: Mongolian written in the Cyrillic script as used in Mongolia ๐Ÿ‡ฒ๐Ÿ‡ณโœจ. Same tea, different cup ๐Ÿต.

Even though case doesn't change meaning in language tags, consistent formatting and presentation will help users out ๐Ÿซถ. The format of the tags and subtags in the registry is RECOMMENDED. In this format, all non-initial two-letter subtags are uppercase, all non-initial four-letter subtags are titlecase, and all other subtags are lowercase ๐Ÿ’…. Pretty, organized, and iconic ๐ŸŒธ.

2.2. Language Subtag Sources and Interpretation ๐ŸŒธ

Okay so the namespace of language tags and their subtags is looked after by the Internet Assigned Numbers Authority (IANA) [RFC2860], following the rules in Section 5 of this document. IANA keeps the Language Subtag Registry, and that's where you find the valid subtags. The other standards mentioned in this section are the source material for that registry ๐Ÿ’…

Terminology in this section:

  • Tag or tags refers to a complete language tag, like "fr-Latn-CA". Examples of tags in this document are in double-quotes ("en-US") โœจ
  • Subtag refers to one section of a tag, separated by hyphens, like the subtag 'Latn' in "fr-Latn-CA". Examples of subtags in this document are in single quotes ('Latn') ๐ŸŽ€
  • Code or codes refers to values defined in external standards that get used as subtags here. For example, 'Latn' is an [ISO15924] script code that was used to define the 'Latn' script subtag for use in a language tag. Examples of codes in this document are in single quotes ('en', 'Latn') ๐Ÿฆ‹

The definitions in this section apply to the various subtags inside the language tags this document defines, except the "grandfathered" tags covered in Section 2.2.8. Those are the exception, bestie ๐Ÿ™ˆ

Language tags are designed so that each subtag type has its own unique length and content restrictions. That means you can figure out a subtag's type even if you don't recognise the subtag itself ๐Ÿงš Tags can be parsed and processed without checking the latest version of the underlying standards or the IANA registry, and the exception handling when parsing tags is way simpler. Iconic, honestly ๐Ÿ‘‘

Subtags in the IANA registry that don't come from an underlying standard can only show up in specific positions in a tag. Specifically, they can only be primary language subtags or variant subtags ๐Ÿ’œ

Note that sequences of private use and extension subtags MUST occur at the end of the sequence of subtags and MUST NOT be interspersed with subtags defined elsewhere in this document. Pay attention to this one, it's a big deal! ๐Ÿ˜ญ

Single-letter and single-digit subtags are reserved for current or future use. These are the current uses:

  • The single-letter subtag 'x' is reserved to introduce a sequence of private use subtags. How private use subtags are interpreted is defined solely by private agreement. It is not defined by the rules in this section or by any standard or registry defined in this document ๐Ÿ”’
  • All other single-letter subtags are reserved to introduce standardised extension subtag sequences, as described in Section 3.7 ๐ŸŒˆ

The single-letter subtag 'i' is used by some grandfathered tags, such as "i-enochian". It always appears in the first position there, so it can't get confused with an extension ๐Ÿงšโ€โ™€๏ธ

2.2.1. Primary Language Subtag ๐Ÿ“

The primary language subtag is the first subtag in a language tag (except for private use and certain grandfathered tags). It cannot be left out. Here are the rules that apply to it:

  1. All two-character language subtags were defined in the IANA registry according to the assignments found in the standard ISO 639 Part 1, "ISO 639-1:2002, Codes for the representation of names of languages -- Part 1: Alpha-2 code" [ISO639-1], or using assignments subsequently made by the ISO 639 Part 1 maintenance agency or governing standardization bodies. โœจ
  2. All three-character language subtags were defined in the IANA registry according to the assignments found in ISO 639 Part 2, "ISO 639-2:1998 - Codes for the representation of names of languages -- Part 2: Alpha-3 code - edition 1" [ISO639-2], or assignments subsequently made by the ISO 639 Part 2 maintenance agency or governing standardization bodies. ๐Ÿ’…
  3. The subtags in the range 'qaa' through 'qtz' are reserved for private use in language tags. These subtags match codes that ISO 639-2 reserved for private use. These codes MAY be used for non-registered primary language subtags, instead of using private use subtags after 'x-'. For more on private use subtags, see Section 4.5 ๐ŸŽ€
  4. All four-character language subtags are reserved for possible future standardisation. Hold that thought, we'll see ๐Ÿ‘€
  5. All language subtags of 5 to 8 characters in length in the IANA registry were defined via the registration process in Section 3.5 and MAY be used to form the primary language subtag. At the time this document was created, there were no examples of this kind of subtag, and future registrations of this type will be discouraged. Primary languages are strongly RECOMMENDED for registration with ISO 639, and proposals rejected by ISO 639/RA will be closely scrutinised before they get registered with IANA ๐Ÿ”ฅ
  6. The single-character subtag 'x' as the primary subtag means the language tag consists solely of subtags whose meaning is defined by private agreement. For example, in the tag "x-fr-CH", the subtags 'fr' and 'CH' SHOULD NOT be taken to represent the French language or the country of Switzerland (or any other value in the IANA registry) unless there is a private agreement in place to do so. See Section 4.5 ๐Ÿฆ‹
  7. The single-character subtag 'i' is used by some grandfathered tags (see Section 2.2.8), such as "i-klingon" and "i-bnn". (Other grandfathered tags have a primary language subtag in their first position.) ๐Ÿงš
  8. Other values MUST NOT be assigned to the primary subtag except by revision or update of this document. Only this doc gets to decide that, no cap ๐Ÿšซ
Note: For languages that have both an ISO 639-1 two-character code and an ISO 639-2 three-character code, only the ISO 639-1 two-character code is defined in the IANA registry.
Note: For languages that have no ISO 639-1 two-character code, and for which the ISO 639-2/T (Terminology) code and the ISO 639-2/B (Bibliographic) code differ, only the Terminology code is defined in the IANA registry. When this document was created, every language that had both kinds of three-character code was also assigned a two-character code. Future assignments of this nature are not expected to happen ๐ŸŒธ
Note: To avoid problems with versioning and subtag choice, like the ones people hit during the move from RFC 1766 to RFC 3066, and because canonical subtags are defined by this document, the ISO 639 Registration Authority Joint Advisory Committee (ISO 639/RA-JAC) included the following statement in [iso639.prin]: "A language code already in ISO 639-2 at the point of freezing ISO 639-1 shall not later be added to ISO 639-1. This is to ensure consistency in usage over time, since users are directed in Internet applications to employ the alpha-3 code when an alpha-2 code for that language is not available." To keep the canonical form of tags stable, if a two-character code gets added to ISO 639-1 for a language that already had a three-character code in ISO 639-2, the two-character code MUST NOT be registered. See Section 3.4 ๐Ÿ’–

For example, if some content were tagged with 'haw' (Hawaiian), which currently has no two-character code, the tag would not be invalidated if ISO 639-1 later assigned a two-character code to the Hawaiian language ๐ŸŒบ

Another example: one of the grandfathered IANA registrations is "i-enochian". The subtag 'enochian' could be registered in the IANA registry as a primary language subtag (assuming ISO 639 doesn't register this language first), which would make tags like "enochian-AQ" and "enochian-Latn" valid ๐Ÿ”ฎ

2.2.2. Extended Language Subtags ๐ŸŒˆ

These are the rules for the extended language subtags:

  1. Three-letter subtags immediately following the primary subtag are reserved for future standardisation, anticipating work that is currently under way on ISO 639 โณ
  2. Extended language subtags MUST follow the primary subtag and precede any other subtags. ๐Ÿ“
  3. There MAY be up to three extended language subtags. ๐Ÿงฉ
  4. Extended language subtags MUST NOT be registered or used to form language tags. Their syntax is described here so that implementations can be compatible with any future revision of this document that does provide for their registration. ๐Ÿ™…โ€โ™€๏ธ

Extended language subtag records, once they show up in the registry, MUST include exactly one 'Prefix' field. That field indicates an appropriate language subtag, or sequence of subtags, that MUST always appear as a prefix to the extended language subtag ๐ŸŽ€

Example: In a future revision or update of this document, the tag "zh-gan" (registered under RFC 3066) might become a valid non-grandfathered (that is, redundant) tag, where the subtag 'gan' might represent the Chinese dialect 'Gan' ๐ŸฅŸ

2.2.3. Script Subtag ๐Ÿ–‹๏ธ

Script subtags indicate the script or writing system variations that tell apart the written forms of a language or its dialects. These are the rules for script subtags:

  1. All four-character subtags were defined according to [ISO15924] ("Codes for the representation of names of scripts"): alpha-4 script codes, or codes subsequently assigned by the ISO 15924 maintenance agency or governing standardisation bodies. They denote the script or writing system used with this language. โœ๏ธ
  2. Script subtags MUST immediately follow the primary language subtag and all extended language subtags, and MUST occur before any other type of subtag described below. ๐Ÿงฑ
  3. The script subtags 'Qaaa' through 'Qabx' are reserved for private use in language tags. These subtags match codes that ISO 15924 reserved for private use. These codes MAY be used for non-registered script values. For more on private use subtags, see Section 4.5 ๐Ÿ”
  4. Script subtags MUST NOT be registered using the process in Section 3.5 of this document. Variant subtags MAY be considered for registration for that purpose. ๐ŸŒท
  5. There MUST be at most one script subtag in a language tag, and the script subtag SHOULD be omitted when it adds no distinguishing value to the tag, or when the primary language subtag's record includes a Suppress-Script field listing the applicable script subtag. Don't be extra with it, bestie ๐Ÿ’…

Example: "sr-Latn" represents Serbian written using the Latin script ๐Ÿ’œ

2.2.4. Region Subtag ๐ŸŒ

Region subtags are how we say "this is for a specific country, territory, or region" ๐Ÿ—บ๏ธ Usually they show up for regional dialects, local usage, or region-specific spelling, like the difference between a Swiss German spelling and a German one. They can also mean "this works everywhere in a region," like Spanish content that's tailored to be understood across Latin America ๐Ÿ’ƒ

Here are the rules for region subtags, bestie ๐Ÿ“

  1. Region subtags MUST follow any language, extended language, or script subtags and MUST precede all other subtags. ๐Ÿ’…
  2. All two-character subtags following the primary subtag were defined in the IANA registry according to the assignments found in [ISO3166-1] ("Codes for the representation of names of countries and their subdivisions -- Part 1: Country codes") using the list of alpha-2 country codes, or using assignments subsequently made by the ISO 3166 maintenance agency or governing standardization bodies. ๐Ÿ‡บ๐Ÿ‡ณ
  3. All three-character subtags consisting of digit (numeric) characters following the primary subtag were defined in the IANA registry according to the assignments found in UN Standard Country or Area Codes for Statistical Use [UN_M.49] or assignments subsequently made by the governing standards body. Note that not all of the UN M.49 codes are defined in the IANA registry. These are the rules for which codes actually get entered into the registry as valid subtags ๐Ÿ‘€

A. UN numeric codes assigned to 'macro-geographical (continental)' or sub-regions MUST be registered in the registry. These codes aren't tied to an ISO 3166 alpha-2 code, and they stand for supra-national areas, usually covering more than one nation, state, province, or territory ๐ŸŒ

B. UN numeric codes for 'economic groupings' or 'other groupings' MUST NOT be registered in the IANA registry and MUST NOT be used to form language tags. ๐Ÿšซ

C. UN numeric codes for countries or areas with ambiguous ISO 3166 alpha-2 codes, when entered into the registry, MUST be defined according to the rules in Section 3.4 and MUST be used to form language tags that represent the country or region for which they are defined. ๐Ÿงฉ

D. UN numeric codes for countries or areas for which there is an associated ISO 3166 alpha-2 code in the registry MUST NOT be entered into the registry and MUST NOT be used to form language tags. Note that the ISO 3166-based subtag in the registry MUST actually be associated with the UN M.49 code in question. ๐Ÿ”—

E. UN numeric codes and ISO 3166 alpha-2 codes for countries or areas listed as eligible for registration in [RFC4645] but not presently registered MAY be entered into the IANA registry via the process described in Section 3.5. Once registered, these codes MAY be used to form language tags. ๐ŸŒฑ

F. All other UN numeric codes for countries or areas that do not have an associated ISO 3166 alpha-2 code MUST NOT be entered into the registry and MUST NOT be used to form language tags. For more information about these codes, see Section 3.4. ๐Ÿ™…โ€โ™€๏ธ

  1. Note: The alphanumeric codes in Appendix X of the UN document MUST NOT be entered into the registry and MUST NOT be used to form language tags. (At the time this document was created, these values matched the ISO 3166 alpha-2 codes.) ๐Ÿ“Ž
  2. There MUST be at most one region subtag in a language tag and the region subtag MAY be omitted, as when it adds no distinguishing value to the tag. One region is the max, periodt ๐Ÿ’–
  3. The region subtags 'AA', 'QM'-'QZ', 'XA'-'XZ', and 'ZZ' are reserved for private use in language tags. These subtags correspond to codes reserved by ISO 3166 for private use. These codes MAY be used for private use region subtags (instead of using a private use subtag sequence). Please refer to Section 4.5 for more information on private use subtags. ๐Ÿ”’

Examples, because examples are everything โœจ

de-CH represents German (de) as used in Switzerland (CH). ๐Ÿง€๐Ÿ‡จ๐Ÿ‡ญ

sr-Latn-CS represents Serbian (sr) written using Latin script (Latn) as used in Serbia and Montenegro (CS). ๐Ÿ‡ท๐Ÿ‡ธ

es-419 represents Spanish (es) appropriate to the UN-defined Latin America and Caribbean region (419). ๐ŸŒด


2.2.5. Variant Subtags ๐ŸŽ€

Variant subtags are for well-recognised variations that define a language or its dialects, and that aren't covered by any of the other subtags. Here are the rules, bestie ๐Ÿ’Œ

  1. Variant subtags are not associated with any external standard. Variant subtags and their meanings are defined by the registration process defined in Section 3.5. ๐Ÿ“š
  2. Variant subtags MUST follow all of the other defined subtags, but precede any extension or private use subtag sequences. ๐Ÿช„
  3. More than one variant MAY be used to form the language tag. ๐ŸŽจ
  4. Variant subtags MUST be registered with IANA according to the rules in Section 3.5 of this document before being used to form language tags. In order to distinguish variants from other types of subtags, registrations MUST meet the following length and content restrictions: ๐Ÿ”
    1. Variant subtags that begin with a letter (a-z, A-Z) MUST be at least five characters long. โœ๏ธ
    2. Variant subtags that begin with a digit (0-9) MUST be at least four characters long. ๐Ÿ”ข

Variant subtag records in the language subtag registry MAY include one or more 'Prefix' fields, which indicate the language tag or tags that would make a suitable prefix (with other subtags, as appropriate) in forming a language tag with the variant. For example, the subtag 'nedis' has a Prefix of "sl", making it suitable to form language tags such as sl-nedis and sl-IT-nedis, but not suitable for use in a tag such as zh-nedis or it-IT-nedis. It's all about the right pairing ๐Ÿ’•

Examples, obviously ๐Ÿฅน

sl-nedis represents the Natisone or Nadiza dialect of Slovenian. ๐Ÿ‡ธ๐Ÿ‡ฎ

de-CH-1996 represents German as used in Switzerland and as written using the spelling reform beginning in the year 1996 C.E. ๐Ÿ“–

Most variants that share a prefix are mutually exclusive. For example, the German orthographic variations '1996' and '1901' SHOULD NOT be used in the same tag, as they represent the dates of different spelling reforms. Not a combo, sorry ๐Ÿ™ˆ A variant that can meaningfully be used in combination with another variant SHOULD include a 'Prefix' field in its registry record that lists that other variant. For example, if another German variant 'example' were created that made sense to use with '1996', then 'example' should include two Prefix fields: "de" and "de-1996". The main character of the registry is the one with the perfect pairings ๐Ÿ‘‘


2.2.6. Extension Subtags ๐Ÿงฉ

Extensions give us a way to extend language tags for all kinds of applications. See Section 3.7. Here's the tea on extensions ๐Ÿซ–

  1. Extension subtags are separated from the other subtags defined in this document by a single-character subtag ("singleton"). The singleton MUST be one allocated to a registration authority via the mechanism described in Section 3.7 and MUST NOT be the letter 'x', which is reserved for private use subtag sequences. ๐Ÿšง
  2. Note: Private use subtag sequences starting with the singleton subtag 'x' are described in Section 2.2.7 below. ๐Ÿ‘€
  3. An extension MUST follow at least a primary language subtag. That is, a language tag cannot begin with an extension. Extensions extend language tags, they do not override or replace them. For example, "a-value" is not a well-formed language tag, while "de-a-value" is. Extensions are the sidekick, not the main character ๐Ÿฆธ
  4. Each singleton subtag MUST appear at most one time in each tag (other than as a private use subtag). That is, singleton subtags MUST NOT be repeated. For example, the tag "en-a-bbb-a-ccc" is invalid because the subtag 'a' appears twice. Note that the tag "en-a-bbb-x-a-ccc" is valid because the second appearance of the singleton 'a' is in a private use sequence. Read the room, one singleton per tag ๐Ÿ™…โ€โ™€๏ธ
  5. Extension subtags MUST meet all of the requirements for the content and format of subtags defined in this document. โœ…
  6. Extension subtags MUST meet whatever requirements are set by the document that defines their singleton prefix and whatever requirements are provided by the maintaining authority. ๐Ÿ“œ
  7. Each extension subtag MUST be from two to eight characters long and consist solely of letters or digits, with each subtag separated by a single '-'. ๐Ÿ”ค
  8. Each singleton MUST be followed by at least one extension subtag. For example, the tag "tlh-a-b-foo" is invalid because the first singleton 'a' is followed immediately by another singleton 'b'. A singleton with nothing after it is just sad ๐Ÿ˜ญ
  9. Extension subtags MUST follow all language, extended language, script, region, and variant subtags in a tag. ๐Ÿ
  10. All subtags following the singleton and before another singleton are part of the extension. Example: In the tag "fr-a-Latn", the subtag 'Latn' does not represent the script subtag 'Latn' defined in the IANA Language Subtag Registry. Its meaning is defined by the extension 'a'. Same spelling, totally different vibe ๐ŸŽญ
  11. In the event that more than one extension appears in a single tag, the tag SHOULD be canonicalized as described in Section 4.4. ๐Ÿชž

For example, if the prefix singleton 'r' and the shown subtags were defined, then the following tag would be a valid example: "en-Latn-GB-boont-r-extended-sequence-x-private". โœจ


2.2.7. Private Use Subtags ๐Ÿ”

Private use subtags are for marking distinctions in language that matter in a given context, by private agreement. Here's how they work ๐Ÿคซ

  1. Private use subtags are separated from the other subtags defined in this document by the reserved single-character subtag 'x'. ๐Ÿซข
  2. Private use subtags MUST conform to the format and content constraints defined in the ABNF for all subtags. ๐Ÿ“
  3. Private use subtags MUST follow all language, extended language, script, region, variant, and extension subtags in the tag. Another way of saying this is that all subtags following the singleton 'x' MUST be considered private use. Example: The subtag 'US' in the tag "en-x-US" is a private use subtag. Everything after the 'x' is off the record ๐Ÿค
  4. A tag MAY consist entirely of private use subtags. ๐ŸŒŸ
  5. No source is defined for private use subtags. Use of private use subtags is by private agreement only. Just between us, bestie ๐Ÿซถ
  6. Private use subtags are NOT RECOMMENDED where alternatives exist or for general interchange. See Section 4.5 for more information on private use subtag choice. Try the public options first ๐Ÿ’…

For example: Users who wished to utilize codes from the Ethnologue publication of SIL International for language identification might agree to exchange tags such as "az-Arab-x-AZE-derbend". This example contains two private use subtags. The first is 'AZE' and the second is 'derbend'. Two secret codes, one cute tag ๐ŸŽ€

2.2.8. Preexisting RFC 3066 Registrations โœจ

Okay so, language tags that IANA already registered back in RFC 1766 and/or RFC 3066 are still valid, bestie ๐ŸŽ€ They stick around in the registry as either "grandfathered" or "redundant" records. Grandfathered tags have one or more subtags that the Language Subtag Registry doesn't define (see Section 3). Redundant tags are made up entirely of subtags defined above, and their separate registration is superseded by this document. For more info, see Section 3.8 ๐Ÿ’…

It's important to note that every language tag formed under the guidelines in this document was either legal and well-formed, or could have been registered under RFC 3066 ๐Ÿซถ

2.2.9. Classes of Conformance ๐Ÿฆ‹

Implementations sometimes need to describe what they can do with the rules and practices in this document, so there are two classes of conforming implementations: "well-formed" processors and "validating" processors. Claims of conformance SHOULD explicitly reference one of these definitions ๐Ÿ’œ

An implementation that claims to check for well-formed language tags MUST:

  • Check that the tag and all of its subtags, including extension and private use subtags, conform to the ABNF or that the tag is on the list of grandfathered tags.
  • Check that singleton subtags that identify extensions do not repeat. For example, the tag en-a-xx-b-yy-a-zz is not well-formed. ๐Ÿ™ˆ

Well-formed processors are strongly encouraged to implement the canonicalization rules contained in Section 4.4 ๐ŸŒธ

An implementation that claims to be validating MUST:

  • Check that the tag is well-formed.
  • Specify the particular registry date for which the implementation performs validation of subtags.
  • Check that either the tag is a grandfathered tag, or that all language, script, region, and variant subtags consist of valid codes for use in language tags according to the IANA registry as of the particular date specified by the implementation.
  • Specify which, if any, extension RFCs as defined in Section 3.7 are supported, including version, revision, and date.
  • For any such extensions supported, check that all subtags used in that extension are valid.
  • For variant and extended language subtags, if the registry contains one or more Prefix fields for that subtag, check that the tag matches at least one prefix. The tag matches if all the subtags in the Prefix also appear in the tag. For example, the prefix es-CO matches the tag es-Latn-CO-x-private because both the es language subtag and CO region subtag appear in the tag. ๐Ÿงš

3. Registry Format and Maintenance ๐Ÿ“

This section defines the Language Subtag Registry and the maintenance and update procedures that go with it, plus a registry for extensions to language tags (Section 3.7). Main character energy ๐Ÿ‘‘

The Language Subtag Registry is a comprehensive list of every subtag that's valid in language tags. That means implementers get a straightforward, reliable way to validate tags, which is so helpful ๐ŸŽ€ The registry will be maintained so that, except for extension subtags, it's possible to validate all of the subtags in a language tag under this document or its revisions or successors. The meaning of the various subtags will also be unambiguous and stable over time. (The meaning of private use subtags, of course, is not defined by the IANA registry ๐ŸŒˆ)

3.1. Format of the IANA Language Subtag Registry ๐Ÿ’–

The IANA Language Subtag Registry ("the registry") is a text file that's machine readable in the format described in this section, plus copies of the registration forms approved through the process in Section 3.5. The existing registration forms for grandfathered and redundant tags taken from RFC 3066 are maintained as part of the obsolete RFC 3066 registry. The remaining set of initial subtags won't get registration forms created for them.

The registry uses the text format described below, which was based on the record-jar format described in [record-jar].

Each line of text is limited to 72 characters, including all whitespace. Records are separated by lines containing only the sequence %% (%x25.25).

Each field can be viewed as a single, logical line of ASCII characters, made of a field-name and a field-body separated by a COLON character (%x3A). For convenience, the field-body part of this idea can be split across multiple lines, and that's called "folding" โœจ The format of the registry is described by the following ABNF (per [RFC4234]):

registry   = record *("%%" CRLF record)
record     = 1*( field-name *SP ":" *SP field-body CRLF )
field-name = (ALPHA / DIGIT) [*(ALPHA / DIGIT / "-") (ALPHA / DIGIT)]
field-body = *(ASCCHAR/LWSP)
ASCCHAR    = %x21-25 / %x27-7E / UNICHAR ; Note: AMPERSAND is %x26
UNICHAR    = "&#x" 2*6HEXDIG ";"

Figure 2: Registry Format ABNF

The sequence .. (%x2E.2E) in a field-body denotes a range of values. A range stands for all subtags of the same length that are in alphabetic or numeric order within that range, including the values explicitly mentioned. For example, 'a..c' denotes the values 'a', 'b', and 'c', and '11..13' denotes the values '11', '12', and '13' ๐Ÿฆ‹

Characters from outside the US-ASCII [ISO646] repertoire, plus the AMPERSAND character ("&", %x26) when it shows up in a field-body, are represented by a "Numeric Character Reference" written in hexadecimal, in the style used by [XML10] (see <http://www.w3.org/TR/REC-xml/#dt-charref>). This is the sequence "&#x" (%x26.23.78), then a hexadecimal representation of the character's code point in [ISO10646], then a closing semicolon (%x3B). For example, the EURO SIGN, U+20AC, would be represented by the sequence &#x20AC;. Note that the hexadecimal notation MAY have between two and six digits ๐Ÿ“

All fields whose field-body contains a date value use the "full-date" format specified in [RFC3339]. For example: "2004-06-28" represents June 28, 2004, in the Gregorian calendar ๐Ÿ“…

The first record in the file contains the single field whose field-name is "File-Date" (see Figure 3). The field-body of this record holds the last modification date of this copy of the registry, which makes it possible to compare different versions of the registry. The registry on the IANA website is the most current one, so versions with an older date than that are not up-to-date ๐Ÿซถ

File-Date: 2004-06-28
%%

Figure 3: Example of the File-Date Record

Subsequent records represent subtags in the registry. Each of the fields in each record MUST occur no more than once, unless otherwise noted below. Each record MUST contain the following fields:

  • Type
    • Type's field-value MUST consist of one of the following strings: "language", "extlang", "script", "region", "variant", "grandfathered", and "redundant" and denotes the type of tag or subtag.
  • Either Subtag or Tag
    • Subtag's field-value contains the subtag being defined. This field MUST only appear in records of whose 'Type' has one of these values: "language", "extlang", "script", "region", or "variant".
    • Tag's field-value contains a complete language tag. This field MUST only appear in records whose 'Type' has one of these values: "grandfathered" or "redundant". Note that the field-value will always follow the 'grandfathered' production in the ABNF in Section 2.1 โœจ
  • Description
    • Description's field-value contains a non-normative description of the subtag or tag. ๐Ÿ’…
  • Added
    • Added's field-value contains the date the record was added to the registry.

The 'Subtag' or 'Tag' field MUST use lowercase letters to form the subtag or tag, with two exceptions. Subtags whose 'Type' field is 'script' (in other words, subtags defined by ISO 15924) MUST use titlecase. Subtags whose 'Type' field is 'region' (in other words, subtags defined by ISO 3166) MUST use uppercase. These exceptions mirror the use of case in the underlying standards ๐ŸŒธ

The field 'Description' MAY appear more than one time and contains a description of the tag or subtag in the record. At least one of the 'Description' fields MUST be written or transcribed into the Latin script, and the same or additional fields MAY also include a description in a non-Latin script. The 'Description' field is for identification purposes and SHOULD NOT be taken to represent the actual native name of the language or variation, or to be in any particular language. Most descriptions are taken directly from source standards such as ISO 639 or ISO 3166 ๐ŸŒˆ

Note: Descriptions in registry entries that correspond to ISO 639, ISO 15924, ISO 3166, or UN M.49 codes are intended only to indicate the meaning of that identifier as defined in the source standard at the time it was added to the registry. The description does not replace the content of the source standard itself. The descriptions are not intended to be the English localized names for the subtags. Localization or translation of language tag and subtag descriptions is out of scope of this document ๐Ÿ™ˆ

Each record MAY also contain the following fields:

  • Preferred-Value
    • For fields of type 'language', 'extlang', 'script', 'region', and 'variant', 'Preferred-Value' contains the subtag of the same 'Type' that is preferred for forming the language tag.
    • For fields of type 'grandfathered' and 'redundant', a canonical mapping to a complete language tag.
  • Deprecated
    • Deprecated's field-value contains the date the record was deprecated.
  • Prefix
    • Prefix's field-value contains a language tag with which this subtag MAY be used to form a new language tag, perhaps with other subtags as well. This field MUST only appear in records whose 'Type' field-value is 'variant' or 'extlang'. For example, the 'Prefix' for the variant 'nedis' is 'sl', meaning that the tags sl-nedis and sl-IT-nedis might be appropriate, while the tag is-nedis is not. ๐Ÿงš
  • Comments
    • Comments contains additional information about the subtag, as deemed appropriate for understanding the registry and implementing language tags using the subtag or tag.
  • Suppress-Script
    • Suppress-Script contains a script subtag that SHOULD NOT be used to form language tags with the associated primary language subtag. This field MUST only appear in records whose 'Type' field-value is 'language'. See Section 4.1. ๐Ÿ’€

The Deprecated field MAY be added to any record through the maintenance process in Section 3.3, or through the registration process in Section 3.5. ๐Ÿ’… Usually it shows up because a standards body like ISO 3166 withdrew a code, which is a real main-character moment for that code ๐Ÿ˜ญ. Sometimes the original deprecation date can't be reconstructed, so the registry shows an approximate one ๐Ÿ—“๏ธ. Deprecated tags and subtags are still valid in language tags, but validating processors SHOULD NOT generate them ๐Ÿ™…โ€โ™€๏ธ. Also, a record with a Deprecated field and no Preferred-Value field has no replacement mapping, so it's just retired with no glow-up path ๐Ÿ’€.

The Preferred-Value field maps its record to another tag or subtag ๐Ÿฆ‹. The value is STRONGLY RECOMMENDED as the best pick when you're choosing a language tag for that record โœจ. These values fall into three groups:

  1. ISO 639 language codes that were later withdrawn in favor of other codes. These are mostly a historical curiosity ๐Ÿ“œ.
  2. ISO 3166 region codes that were withdrawn in favor of a new code. This happens when a country changes its name or administration enough to need a new region code ๐ŸŒ.
  3. Tags grandfathered from RFC 3066. A lot of these are obsolete now because ISO 639 later encoded the same values ๐Ÿงš.

Any record with a Preferred-Value field MUST also have a Deprecated field ๐ŸŽ€. That field holds the deprecation date, which is the whole point, because a processor can use the registry to build the valid, non-deprecated set of subtags for any given date ๐Ÿ“…. A processor can also build the set of valid language tags matching a tag for every date up to the registry's date ๐Ÿ•ฐ๏ธ. Those mappings MAY be beneficial to applications that match, select, or filter content by language tags ๐Ÿซถ.

Heads up: Preferred-Value mappings in records of type region don't always mean exactly the same thing as the original value ๐Ÿ‘€. A country code can change for lots of reasons, and how that affects language tags depends on what the change actually was โœจ.

And especially this part: the Preferred-Value field does not imply retagging content that uses the affected subtag ๐Ÿ™…โ€โ™€๏ธ. Please don't go re-tagging everything just because a mapping exists.

The Preferred-Value field MUST NOT be modified once it's in the registry ๐Ÿ”’. It MAY be added to records of type "grandfathered" and "region" under the rules in Section 3.3 ๐Ÿ’–. Otherwise, the field MUST NOT be added to any record that's already in the registry ๐Ÿšซ.

The Preferred-Value field in records of type "grandfathered" and "redundant" holds whole language tags that are strongly RECOMMENDED to use in place of the record's value ๐ŸŒˆ. A lot of these mappings came from tags that got deprecated before this document was adopted ๐Ÿ“. For example, the tag "no-nyn" was deprecated in favor of the ISO 639-1-defined language code nn ๐Ÿซ .

Records of type variant MAY have more than one field of type Prefix ๐ŸŽ€. More Prefix fields MAY be added to a variant record through the registration process ๐Ÿ“.

Records of type extlang MUST have exactly one Prefix field ๐Ÿงฉ.

The value of a Prefix field is a language tag whose subtags work well with this subtag ๐Ÿ’œ. For example, the variant subtag 1996 has a Prefix of "de". That means tags starting with "de-" are a good match for this subtag, so "de-Latg-1996" and "de-CH-1996" are both acceptable, but "fr-1996" is a no-go ๐Ÿ™…โ€โ™€๏ธ.

The Prefix field MUST NOT be removed from any record ๐Ÿ”. Its value MUST NOT be modified either ๐Ÿซถ.

The Comments field MAY appear more than once per record ๐Ÿ’ฌ. It MAY be inserted or changed through the registration process, and no guarantee of stability is given ๐ŸŒธ. Its content isn't restricted, except by the need to register the information, the suitability of the request, and reasonable practical size limits ๐Ÿ“.

The Suppress-Script field MUST only appear in records whose Type value is language ๐ŸŽฏ. It MUST NOT appear more than one time in a record โ˜๏ธ. It names a script that's used to write the overwhelming majority of documents in that language, so it adds no distinguishing information to a language tag ๐Ÿคทโ€โ™€๏ธ. It helps keep tags made under this document compatible with language tags and tag processors or consumers based on RFC 3066 ๐Ÿค. For example, virtually all Icelandic documents are written in the Latin script, so the subtag Latn is redundant in the tag is-Latn ๐Ÿ‡ฎ๐Ÿ‡ธ.


3.2. Language Subtag Reviewer โœจ

The Language Subtag Reviewer is appointed by the IESG for an indefinite term, and can be removed or replaced at the IESG's discretion ๐Ÿ‘‘. The Language Subtag Reviewer moderates the ietf-languages mailing list, responds to registration requests, and handles the other registry maintenance duties in Section 3.3 ๐Ÿ“ฌ. Only the Language Subtag Reviewer is allowed to ask IANA to change, update, or add records in the Language Subtag Registry ๐Ÿ”‘.

The Language Subtag Reviewer's decisions or performance MAY be appealed to the IESG, under the same rules as other IETF decisions (see [RFC2026]) โš–๏ธ. The IESG can reverse or overturn the Language Subtag Reviewer's decision, give guidance, or take other appropriate actions ๐Ÿ’….


3.3. Maintenance of the Registry ๐Ÿ› ๏ธ

Keeping the registry up to date means that as codes get assigned or withdrawn by ISO 639, ISO 15924, ISO 3166, and UN M.49, the Language Subtag Reviewer MUST evaluate each change, check whether it conflicts with existing registry entries, and send the information to IANA for inclusion in the registry ๐Ÿงน. If a change happens and the Language Subtag Reviewer doesn't handle it in a timely manner, any interested party MAY use the procedure in Section 3.5 to register the update ๐Ÿ™‹โ€โ™€๏ธ.

Note: The redundant and grandfathered entries together are the complete list of tags registered under [RFC3066] ๐Ÿ“š. The redundant tags are the ones that can now be formed using the subtags defined in the registry together with the rules of Section 2.2 โœจ. The grandfathered entries include the ones that can never be legal under those same provisions ๐Ÿšซ.

The set of redundant and grandfathered tags is permanent and stable ๐Ÿชจ. New entries MUST NOT be added to this section, and existing entries MUST NOT be removed ๐Ÿ”’. Records of type grandfathered MAY have their type converted to redundant; see item 12 in Section 3.6 for more information ๐Ÿฆ‹. The decision-making process about which tags were grandfathered at first and which were made redundant is described in [RFC4645] ๐Ÿ—ณ๏ธ.

RFC 3066 tags that were deprecated before this document was adopted are part of the grandfathered list ๐Ÿซ™. Their component subtags were not included as registered variants, although they're still eligible for registration ๐ŸŒฑ. For example, the tag "art-lojban" was deprecated in favor of the language subtag jbo ๐ŸŽญ.

The Language Subtag Reviewer MUST ensure that new subtags meet the requirements in Section 4.1, or submit an appropriate alternate subtag as described in that section ๐Ÿง. When a change or addition to the registry is needed, the Language Subtag Reviewer MUST prepare the complete record, including all fields, and forward it to IANA for insertion into the registry ๐Ÿ“. Each record being modified or inserted MUST be forwarded in a separate message ๐Ÿ’Œ.

If a record represents a new subtag that isn't in the registry yet, the message's subject line MUST include the word "INSERT" ๐Ÿ†•. If the record represents a change to an existing subtag, the subject line of the message MUST include the word "MODIFY" โœ๏ธ. The message MUST contain both the record for the subtag being inserted or modified and the new File-Date record ๐ŸŽ€. Here's an example of what the body of the message might contain ๐Ÿ‘‡:

LANGUAGE SUBTAG MODIFICATION
File-Date: 2005-01-02
%%
Type: variant
Subtag: nedis
Description: Natisone dialect
Description: Nadiza dialect
Added: 2003-10-09
Prefix: sl
Comments: This is a comment shown
  as an example.
%%

Figure 4: Example of a Language Subtag Modification Form

Whenever an entry is created or modified in the registry, the File-Date record at the start of the registry gets updated to reflect the most recent modification date, in the [RFC3339] "full-date" format ๐Ÿ“†.

Before forwarding a new registration to IANA, the Language Subtag Reviewer MUST ensure that values in the Subtag field match case according to the description in Section 3.1 ๐Ÿ” ๐Ÿ’–.

3.4. Stability of IANA Registry Entries

okay bestie, this part is literally the reason language tags can be trusted ๐Ÿ”’โœจ the registry entries have to stay stable forever, or else a tag could mean something different tomorrow and that would be chaos ๐Ÿ’€. these rules make sure a specific language tag's meaning stays put over time and never changes ๐Ÿซถ

these rules are all about how changes to codes (including withdrawal and deprecation of codes) that are maintained by ISO 639, ISO 15924, ISO 3166, and UN M.49 get reflected in the IANA Language Subtag Registry ๐ŸŒธ assignments to the IANA Language Subtag Registry MUST follow these stability rules:

  1. Values in the fields Type, Subtag, Tag, Added, Deprecated and Preferred-Value MUST NOT be changed, and they are guaranteed to stay stable over time ๐Ÿ”’๐Ÿ’œ
  2. Values in the Description field MUST NOT be changed in a way that would invalidate previously-existing tags ๐Ÿงš they MAY be broadened somewhat in scope, changed to add information, or adapted to the most common modern usage. countries change their official names sometimes, and a historical example is "Upper Volta" becoming "Burkina Faso" ๐ŸŒโœจ
  3. Values in the field Prefix MAY be added to records of type variant through the registration process ๐Ÿฆ‹
  4. Values in the field Prefix MAY be modified, as long as the modifications broaden the set of prefixes. so a prefix MAY be replaced by one of its own prefixes. for example, the prefix "en-US" could be replaced by "en", but not by the prefixes "en-Latn", "fr", or "en-US-boont" ๐Ÿ™ˆ if one of those prefixes were needed, a new Prefix SHOULD be registered instead ๐ŸŽ€
  5. Values in the field Prefix MUST NOT be removed ๐Ÿ”ฅ
  6. The field Comments MAY be added, changed, modified, or removed through the registration process or any of the processes or considerations described in this section ๐Ÿ’…
  7. The field Suppress-Script MAY be added or removed through the registration process ๐ŸŒˆ
  8. Codes assigned by ISO 639, ISO 15924, and ISO 3166 that don't conflict with existing subtags of the associated type, and whose meaning isn't the same as an existing subtag of the same type, get entered into the IANA registry as new records โœจ
  9. Codes assigned by ISO 639, ISO 15924, or ISO 3166 that get withdrawn by their respective maintenance or registration authority still stay valid in language tags ๐Ÿ’– a Deprecated field containing the date of withdrawal gets added to the record. if a new record of the same type gets added that represents a replacement value, then a Preferred-Value field MAY also be added ๐Ÿ“ the registration process MAY be used to add comments about the withdrawal of the code by the respective standard ๐Ÿง

Example: the region code 'TL' was assigned to the country 'Timor-Leste', replacing the code 'TP' (which was assigned to 'East Timor' when it was under administration by Portugal). the subtag 'TP' stays valid in language tags, but its record has a 'Preferred-Value' of 'TL', and its field 'Deprecated' contains the date the new code was assigned ('2004-07-06') ๐ŸŒธ

  1. Codes assigned by ISO 639, ISO 15924, or ISO 3166 that conflict with existing subtags of the associated type, including subtags that are deprecated, MUST NOT be entered into the registry ๐Ÿšซ the following extra considerations apply to subtag values that get reassigned:
    • A. For ISO 639 codes, if the newly assigned code's meaning isn't represented by a subtag in the IANA registry, the Language Subtag Reviewer, as described in Section 3.5, SHALL prepare a proposal for entering, as soon as practical, a registered language subtag as an alternate value for the new code ๐Ÿง  the form of that registered language subtag is up to the Language Subtag Reviewer's discretion, and it MUST conform to the other restrictions on language subtags in this document ๐Ÿ’œ
    • B. For all subtags whose meaning comes from an external standard (that's ISO 639, ISO 15924, ISO 3166, or UN M.49), if a new meaning is assigned to an existing code and the new meaning broadens that code's meaning, then the meaning for the associated subtag MAY be changed to match ๐Ÿฆ‹ but the meaning of a subtag MUST NOT be narrowed, because that could make an unknown proportion of the existing uses of a subtag invalid ๐Ÿ˜ญ note: the ISO 639 maintenance agency/registration authority (MA/RA) has adopted a similar stability policy ๐Ÿซถ
    • C. For ISO 15924 codes, if the newly assigned code's meaning isn't represented by a subtag in the IANA registry, the Language Subtag Reviewer, as described in Section 3.5, SHALL prepare a proposal for entering, as soon as practical, a registered variant subtag as an alternate value for the new code โœจ the form of that registered variant subtag is up to the Language Subtag Reviewer's discretion, and it MUST conform to the other restrictions on variant subtags in this document ๐ŸŒˆ
    • D. For ISO 3166 codes, if the newly assigned code's meaning is associated with the same UN M.49 code as another 'region' subtag, then the existing region subtag stays as the preferred value for that region and no new entry gets created ๐ŸŒท a comment MAY be added to the existing region subtag to show how it relates to the new ISO 3166 code ๐ŸŽ€
    • E. For ISO 3166 codes, if the newly assigned code's meaning is associated with a UN M.49 code that isn't represented by an existing region subtag, then the Language Subtag Reviewer, as described in Section 3.5, SHALL prepare a proposal for entering the appropriate UN M.49 country code as an entry in the IANA registry ๐Ÿ—บ๏ธ
    • F. For ISO 3166 codes that have no associated UN numeric code, the Language Subtag Reviewer SHALL petition the UN to create one ๐Ÿ™ if there's no response from the UN within ninety days of the request being sent, the Language Subtag Reviewer SHALL prepare a proposal for entering, as soon as practical, a registered variant subtag as an alternate value for the new code. the form of that registered variant subtag is up to the Language Subtag Reviewer's discretion, and it MUST conform to the other restrictions on variant subtags in this document ๐Ÿ’€ this situation is very unlikely to ever happen, so don't panic ๐Ÿ’–
  2. UN M.49 has codes for both countries and areas (like '276' for Germany) and for geographical regions and sub-regions (like '150' for Europe) ๐ŸŒ UN M.49 country or area codes that don't have a corresponding ISO 3166 code SHOULD NOT be registered, except as a surrogate for an ISO 3166 code that's blocked from registration by an existing subtag ๐Ÿšง if such a code becomes necessary, the registration authority for ISO 3166 SHOULD first be petitioned to assign a code to the region. if the petition for a code assignment by ISO 3166 gets refused or isn't acted on in a timely manner, the registration process described in Section 3.5 MAY then be used to register the corresponding UN M.49 code ๐Ÿงš when this document was written, there were only four such codes: 830 (Channel Islands), 831 (Guernsey), 832 (Jersey), and 833 (Isle of Man) ๐Ÿ๏ธ this way, UN M.49 codes stay available as the value of last resort in cases where ISO 3166 reassigns a deprecated value in the registry ๐Ÿซถ
  3. Stability provisions apply to grandfathered tags, with this exception: if all of the subtags in a grandfathered tag become valid subtags in the IANA registry, then the Type field in that record changes from 'grandfathered' to 'redundant' ๐Ÿ‘‘ this won't affect language tags that match the grandfathered tag, since those tags will now match valid generative subtag sequences ๐Ÿ’… for example, if the subtag 'gan' in the language tag "zh-gan" were registered as an extended language subtag, then the grandfathered tag "zh-gan" would be deprecated (but existing content or implementations that use "zh-gan" would stay valid) ๐Ÿฆ‹

3.5. Registration Procedure for Subtags ๐Ÿ’Œ

okay so, if you want a subtag that isn't in the IANA Language Subtag Registry yet, you must follow the procedure here. no skipping, no shortcuts ๐Ÿ™…โ€โ™€๏ธ

The MUST is written as MUST in the rules below, and every BCP 14 word keeps its exact strength.

Only subtags of type 'language' and 'variant' are considered for independent registration of new subtags ๐ŸŽ€ Stability stuff, plus the subtags needed to keep the registry synced with ISO 639, ISO 15924, ISO 3166, and UN M.49 (within the limits this document sets), are handled in Section 3.3. The stability rules live in Section 3.4.

This procedure MAY also be used to register or change the information in the 'Description', 'Comments', 'Deprecated', or 'Prefix' fields of a subtag's record, as Section 3.4 explains ๐ŸŒธ Changes to all other fields in the IANA registry are NOT permitted, bestie, so don't even try ๐Ÿ˜ญ

Registering a new subtag, or asking for changes to an existing tag or subtag, starts with filling out the registration form below. Each response has no size limit, so you can really describe your registration. The fields in the "Record Requested" section SHOULD follow the requirements in Section 3.1 โœจ

LANGUAGE SUBTAG REGISTRATION FORM
1. Name of requester:
2. E-mail address of requester:
3. Record Requested:

   Type:
   Subtag:
   Description:
   Prefix:
   Preferred-Value:
   Deprecated:
   Suppress-Script:
   Comments:

4. Intended meaning of the subtag:
5. Reference to published description
   of the language (book or article):
6. Any other relevant information:

           Figure 5: The Language Subtag Registration Form

The subtag registration form MUST be sent to <ietf-languages@iana.org> for a two-week review period before it can be submitted to IANA. (It's an open list, and anyone can join by sending a request to <ietf-languages-request@iana.org> ๐Ÿ’–)

Variant subtags are usually registered for use with a particular range of language tags. For example, the subtag rozaj is meant for language tags that start with the primary language subtag "sl", since Resian is a dialect of Slovenian ๐Ÿ‡ธ๐Ÿ‡ฎ So rozaj would fit in tags like sl-Latn-rozaj or sl-IT-rozaj. That info is stored in the 'Prefix' field in the registry. Variant registration requests SHOULD include at least one 'Prefix' field in the registration form.

Extended language subtags are reserved for future standardization ๐Ÿ”ฎ Once they're allowed for registration, they will be REQUIRED to include exactly one 'Prefix' field.

The 'Prefix' field for a given registered subtag exists in the IANA registry as a guide to usage. Additional prefixes MAY be added by filing an additional registration form. On that form, the "Any other relevant information:" field MUST indicate that it is the addition of a prefix ๐Ÿงš

Requests to add a prefix to a variant subtag that imply a different semantic meaning will probably be rejected ๐Ÿ’€ For example, a request to add the prefix "de" to the subtag 'nedis' so that the tag "de-nedis" represented some German dialect would be rejected. The 'nedis' subtag represents a particular Slovenian dialect, and the extra registration would change the semantic meaning assigned to the subtag. A separate subtag SHOULD be proposed instead.

The 'Description' field MUST contain a description of the tag being registered, written or transcribed into the Latin script. It MAY also include a description in a non-Latin script. Non-ASCII characters MUST be escaped using the syntax described in Section 3.1 ๐ŸŒ The 'Description' field is used for identification purposes, so it doesn't necessarily represent the actual native name of the language or variation, or have to be in any particular language.

While the 'Description' field itself is not guaranteed to be stable, and errata corrections MAY be undertaken from time to time, attempts to provide translations or transcriptions of entries in the registry itself will probably be frowned upon by the community or rejected outright. Changes like that have an impact on the provisions in Section 3.4 ๐Ÿ™ˆ

When the two-week period has passed, the Language Subtag Reviewer either forwards the record to be inserted or modified to iana@iana.org according to the procedure described in Section 3.3, or rejects the request because of significant objections raised on the list or due to problems with constraints in this document (which MUST be explicitly cited). The Language Subtag Reviewer MAY also extend the review period in two-week increments to permit further discussion. The Language Subtag Reviewer MUST indicate on the list whether the registration has been accepted, rejected, or extended following each two-week period ๐Ÿ“ฃ

Note that the Language Subtag Reviewer MAY raise objections on the list if they so desire. The important thing is that the objection MUST be made publicly ๐Ÿ‘€

The applicant is free to modify a rejected application with additional information and submit it again. This restarts the two-week comment period ๐Ÿ”

Decisions made by the Language Subtag Reviewer MAY be appealed to the IESG [RFC2028] under the same rules as other IETF decisions [RFC2026] โš–๏ธ

All approved registration forms are available online in the directory http://www.iana.org/numbers.html under "languages" ๐Ÿ“‚

Updates or changes to existing records follow the same procedure as new registrations. The Language Subtag Reviewer decides whether there is consensus to update the registration following the two-week review period. Normally, objections by the original registrant carry extra weight in forming such a consensus ๐Ÿ’œ

Registrations are permanent and stable. Once registered, subtags will not be removed from the registry and will remain a valid way in which to specify a specific language or variant ๐Ÿ’Ž

Note: The purpose of the "Description" in the registration form is to help people verify whether a language is registered, or what language or language variation a particular subtag refers to. In most cases, a reference to an authoritative grammar or dictionary of that language will be useful. In cases where no such work exists, other well-known works describing that language or written in that language MAY be appropriate. The Language Subtag Reviewer decides what constitutes "good enough" reference material. This requirement is not intended to exclude particular languages or dialects due to the size of the speaker population or lack of a standardized orthography. Minority languages will be considered equally on their own merits. ๐Ÿซถ


3.6. Possibilities for Registration ๐Ÿฆ‹

Possibilities for registration of subtags, or information about subtags, include:

  • Primary language subtags for languages not listed in ISO 639 that are not variants of any listed or registered language MAY be registered. At the time this document was created, there were no examples of this form of subtag. Before attempting to register a language subtag, there MUST be an attempt to register the language with ISO 639. Subtags MUST NOT be registered for codes that exist in ISO 639-1 or ISO 639-2, that are under consideration by the ISO 639 maintenance or registration authorities, or that have never been attempted for registration with those authorities. If ISO 639 has previously rejected a language for registration, it is reasonable to assume that there must be additional, very compelling evidence of need before it will be registered in the IANA registry (to the extent that it is very unlikely that any subtags will be registered of this type).
  • Dialect or other divisions or variations within a language, its orthography, writing system, regional or historical usage, transliteration or other transformation, or distinguishing variation MAY be registered as variant subtags. An example is the 'rozaj' subtag (the Resian dialect of Slovenian).
  • The addition or maintenance of fields (generally of an informational nature) in Tag or Subtag records as described in Section 3.1 and subject to the stability provisions in Section 3.4. This includes descriptions, comments, deprecation and preferred values for obsolete or withdrawn codes, or the addition of script or extlang information to primary language subtags.
  • The addition of records and related field value changes necessary to reflect assignments made by ISO 639, ISO 15924, ISO 3166, and UN M.49 as described in Section 3.4.

Subtags proposed for registration that would cause all or part of a grandfathered tag to become redundant, but whose meaning conflicts with or alters the meaning of the grandfathered tag, MUST be rejected โŒ

This document leaves the decision on what subtags or changes to subtags are appropriate (or not) to the registration process described in Section 3.5.

Note: four-character primary language subtags are reserved to allow for the possibility of alpha4 codes in some future addition to the ISO 639 family of standards.

ISO 639 defines a maintenance agency for additions to and changes in the list of languages in ISO 639. This agency is:

International Information Centre for Terminology (Infoterm)
Aichholzgasse 6/12, AT-1120
Wien, Austria
Phone: +43 1 26 75 35 Ext. 312 Fax: +43 1 216 32 72

ISO 639-2 defines a maintenance agency for additions to and changes in the list of languages in ISO 639-2. This agency is:

Library of Congress
Network Development and MARC Standards Office
Washington, D.C. 20540 USA
Phone: +1 202 707 6237 Fax: +1 202 707 0115
URL: http://www.loc.gov/standards/iso639-2

The maintenance agency for ISO 3166 (country codes) is:

ISO 3166 Maintenance Agency
c/o International Organization for Standardization
Case postale 56
CH-1211 Geneva 20 Switzerland
Phone: +41 22 749 72 33 Fax: +41 22 749 73 49
URL: http://www.iso.org/iso/en/prods-services/iso3166ma/index.html

The registration authority for ISO 15924 (script codes) is:

Unicode Consortium Box 391476
Mountain View, CA 94039-1476, USA
URL: http://www.unicode.org/iso15924

The Statistics Division of the United Nations Secretariat maintains the Standard Country or Area Codes for Statistical Use and can be reached at:

Statistical Services Branch
Statistics Division
United Nations, Room DC2-1620
New York, NY 10017, USA

Fax: +1-212-963-0623
E-mail: statistics@un.org
URL: http://unstats.un.org/unsd/methods/m49/m49alpha.htm

3.7. Extensions and Extensions Registry โœจ

Okay so, extension subtags are the ones introduced by single-character subtags (called "singletons") other than 'x' ๐Ÿ’– They're reserved for making identifiers that include a language component and still work with apps that understand language tags ๐ŸŽ€

This document sets up the structure and form of extensions so that implementations can be built to be forward compatible with apps that might use singletons in the future ๐Ÿฆ‹ Defining a way to maintain singletons also gives this document some stability, because it lowers the chances of needing future revisions or updates. Literally the best kind of future-proofing ๐Ÿซถ

IANA assigns single-character subtags under the "IETF Consensus" policy defined by [RFC2434] ๐Ÿ’… That policy needs an RFC, and that RFC SHALL define the name, purpose, processes, and procedures for maintaining the subtags. The maintaining or registering authority, including its name, contact email, discussion list email, and registry URL location, MUST be clearly indicated in the RFC. The RFC MUST specify or include each of the following:

  • The specification MUST reference the specific version or revision of this document that governs its creation and MUST reference this section of this document.
  • The specification and all subtags defined by the specification MUST follow the ABNF and other rules for the formation of tags and subtags as defined in this document. In particular, it MUST specify that case is not significant and that subtags MUST NOT exceed eight characters in length.
  • The specification MUST specify a canonical representation.
  • The specification of valid subtags MUST be available over the Internet and at no cost.
  • The specification MUST be in the public domain or available via a royalty-free license acceptable to the IETF and specified in the RFC.
  • The specification MUST be versioned, and each version of the specification MUST be numbered, dated, and stable.
  • The specification MUST be stable. That is, extension subtags, once defined by a specification, MUST NOT be retracted or change in meaning in any substantial way.
  • The specification MUST include in a separate section the registration form reproduced in this section (below) to be used in registering the extension upon publication as an RFC.
  • IANA MUST be informed of changes to the contact information and URL for the specification.

IANA will keep a registry of allocated single-character (singleton) subtags ๐Ÿ“š This registry MUST use the record-jar format described by the ABNF in Section 3.1. Once an extension gets published as an RFC, the maintaining authority defined in the RFC MUST forward this registration form to iesg@ietf.org, who MUST forward the request to iana@iana.org. The maintaining authority of the extension MUST keep the record accurate by sending an updated full copy of the record to iana@iana.org with the subject line "LANGUAGE TAG EXTENSION UPDATE" whenever the content changes. Only the 'Comments', 'Contact_Email', 'Mailing_List', and 'URL' fields MAY be modified in these updates.

Not maintaining this record, maintaining the corresponding registry, or meeting the other conditions this section imposes MAY be appealed to the IESG [RFC2028] under the same rules as other IETF decisions (see [RFC2026]), and it MAY result in the authority to maintain the extension being withdrawn or reassigned by the IESG ๐Ÿ˜ญ Serious stuff, bestie.

Here's the registration form template ๐ŸŽ€

%%
Identifier:
Description:
Comments:
Added:
RFC:
Authority:
Contact_Email:
Mailing_List:
URL:
%%

Figure 6: Format of Records in the Language Tag Extensions Registry

Breaking down the fields ๐Ÿงš

  • Identifier holds the single-character subtag (singleton) assigned to the extension. The Internet-Draft submitted to define the extension SHOULD specify which letter or digit to use, although the IESG MAY change the assignment when approving the RFC.
  • Description holds the name and description of the extension.
  • Comments is an OPTIONAL field and MAY contain a broader description of the extension.
  • Added holds the date the RFC was published, in the "full-date" format specified in [RFC3339]. For example: 2004-06-28 represents June 28, 2004, in the Gregorian calendar ๐ŸŒธ
  • RFC holds the RFC number assigned to the extension.
  • Authority holds the name of the maintaining authority for the extension.
  • Contact_Email holds the email address used to contact the maintaining authority.
  • Mailing_List holds the URL or subscription email address of the mailing list used by the maintaining authority.
  • URL holds the URL of the registry for this extension.

Whether an Internet-Draft meets the conditions above, and the decision to grant or withhold that authority, rests solely with the IESG ๐Ÿ‘‘ It's also subject to the normal review and appeals process that goes with the RFC process.

Extension authors, I'm going to be extra about this ๐Ÿ™ˆ Many processors (including most well-formed ones) won't know about any special relationships or meaning in the order of extension subtags. Authors SHOULD avoid subtag relationships or canonicalization mechanisms that get in the way of matching, or that clash with length restrictions that sometimes exist in common protocols where the extension is used. Applications MAY truncate the subtags when matching or when fitting into limited lengths, so it is RECOMMENDED that the most significant information go in the most significant (left-most) subtags, and that the specification handle truncated subtags gracefully ๐Ÿ’œ

When a language tag is going to be used in a specific, known protocol, it is RECOMMENDED that the tag not contain extensions that the protocol doesn't support. Also note that some protocols MAY impose upper limits on the length of the strings used to store or transport the language tag โœจ

3.8. Initialization of the Registries ๐ŸŒˆ

When this document gets adopted, we need an initial version of the Language Subtag Registry with the subtags that are valid in a language tag from the start ๐Ÿ“ That collection, along with a description of how it was made, is described by [RFC4645]. IANA SHALL publish the initial version of the registry described by this document using the content of [RFC4645]. Once IANA publishes it, the maintenance procedures, rules, and registration processes in this document become available for new registrations or updates.

Registrations that are already in process under the rules defined in [RFC3066] when this document is adopted MAY be completed under the former rules, at the discretion of the Language Tag Reviewer (as described in [RFC3066]). Until the IESG officially appoints a Language Subtag Reviewer, the existing Language Tag Reviewer SHALL serve as the Language Subtag Reviewer ๐Ÿซถ

Any new registrations submitted using the RFC 3066 forms or format after this document is adopted and IANA publishes the registry MUST be rejected ๐Ÿšซ

We also need an initial version of the Language Tag Extensions Registry described in Section 3.7 โœจ The Language Tag Extensions Registry SHALL be initialized with a single record containing a single field of type "File-Date" as a placeholder for future assignments.

4. Formation and Processing of Language Tags ๐Ÿ’…

This section covers how to use the information in the registry together with the tag syntax to choose, form, and process language tags ๐Ÿฆ‹

4.1. Choice of Language Tag โœจ

Okay so sometimes you're staring at a few different tags for the exact same text and you're like, which one?? ๐Ÿ˜ญ Here's the tea. Interop is literally best when everyone uses the same tag for the same language ๐Ÿ’–. If your app has needs that make these rules not fit, it risks wrecking interop, so it is strongly RECOMMENDED that users not make up their own rules for tag choice ๐Ÿ™…โ€โ™€๏ธ.

Subtags SHOULD only show up where they add useful distinguishing info, because extra subtags mess with the meaning, understanding, and processing of language tags ๐Ÿง. Users and implementations SHOULD follow the Prefix and Suppress-Script fields in the registry (defined in Section 3.1), since those fields tell you when extra subtags SHOULD (and SHOULD NOT) be used in a tag ๐ŸŒธ.

Script subtags are a big deal ๐Ÿฆ‹. Many apps can benefit from them, as long as you're consistent within a given context. Script subtags weren't formally defined in RFC 3066, and they can mess with matching and subtag identification for RFC 3066 implementations, because they sit between the primary language and region subtags. For example, if a user requests content in an implementation of Section 2.5 of [RFC3066] using the language range "en-US", content labeled "en-Latn-US" will NOT match the request ๐Ÿ’€. So it's important to know when script subtags are customarily used and when they ought not to be. In the registry, the Suppress-Script field helps keep tags from this document compatible with RFC 3066 tags and tag processors or consumers, by defining when users SHOULD NOT include a script subtag with a particular primary language subtag ๐Ÿซถ.

Extended language subtags (type extlang in the registry; see Section 3.1) also sit between the primary language and region subtags, and they're reserved for future standardization โœจ. Apps might benefit from using them judiciously in the future, and similar recommendations are expected to apply to them as apply to script subtags ๐Ÿ”ฅ.

Standards, protocols, and applications that reference this document normatively but apply different rules than the ones in this section MUST specify how the procedure varies from the one given here ๐Ÿ“. No cap, that's a must-do.

The choice of subtags used to form a language tag SHOULD be guided by the following rules ๐Ÿ‘‘:

  1. Use as precise a tag as possible, but no more specific than is justified. Avoid using subtags that aren't important for distinguishing content in an application ๐Ÿ’….
    • For example, de might suffice for tagging an email written in German, while "de-CH-1996" is probably unnecessarily precise for such a task ๐Ÿ™ˆ.
  2. The script subtag SHOULD NOT be used to form language tags unless the script adds some distinguishing information to the tag. The field Suppress-Script in the primary language record in the registry indicates which script subtags do not add distinguishing information for most applications ๐ŸŒˆ.
    • For example, the subtag Latn should not be used with the primary language en because nearly all English documents are written in the Latin script and it adds no distinguishing information. However, if a document were written in English mixing Latin script with another script such as Braille (Brai), then it might be appropriate to indicate both scripts to aid in content selection, such as the application of a style sheet ๐Ÿฆ‹.
  3. If a tag or subtag has a Preferred-Value field in its registry entry, then the value of that field SHOULD be used to form the language tag in preference to the tag or subtag in which the preferred value appears ๐Ÿ“.
    • For example, use he for Hebrew in preference to iw ๐Ÿ’œ.
  4. The und (Undetermined) primary language subtag SHOULD NOT be used to label content, even if the language is unknown. Omitting the language tag altogether is preferred to using a tag with a primary language subtag of und. The und subtag MAY be useful for protocols that require a language tag to be provided. The und subtag MAY also be useful when matching language tags in certain situations ๐Ÿคทโ€โ™€๏ธ.
  5. The mul (Multiple) primary language subtag SHOULD NOT be used whenever the protocol allows separate tags for multiple languages, as is the case for the Content-Language header in HTTP. The mul subtag conveys little useful information: content in multiple languages SHOULD individually tag the languages where they appear, or otherwise indicate the actual language in preference to the mul subtag ๐Ÿงš.
  6. The same variant subtag SHOULD NOT be used more than once within a language tag ๐Ÿ™…โ€โ™€๏ธ.
    • For example, do not use "de-DE-1901-1901" ๐Ÿ’€.

To ensure consistent backward compatibility, this document has several provisions to account for potential instability in the standards used to define the subtags that make up language tags ๐Ÿ›ก๏ธ. These provisions mean that no language tag created under the rules in this document will become obsolete ๐ŸŽ€. Iconic behaviour, honestly.


4.2. Meaning of the Language Tag ๐ŸŒท

The relationship between the tag and the information it relates to is defined by the context the tag appears in. So this section only gives possible examples of its usage ๐Ÿ’ญ.

  • For a single information object, the associated language tags might be interpreted as the set of languages that is necessary for a complete comprehension of the complete object. Example: Plain text documents ๐Ÿ“„.
  • For an aggregation of information objects, the associated language tags could be taken as the set of languages used inside components of that aggregation. Examples: Document stores and libraries ๐Ÿ“š.
  • For information objects whose purpose is to provide alternatives, the associated language tags could be regarded as a hint that the content is provided in several languages, and that you have to inspect each of the alternatives to find its language or languages. In this case, the presence of multiple tags might not mean that you need to be multi-lingual to get complete understanding of the document ๐Ÿง . Example: MIME multipart/alternative.
  • In markup languages, such as HTML and XML, language information can be added to each part of the document identified by the markup structure (including the whole document itself). For example, you could write <span lang="fr">C'est la vie.</span> inside a Norwegian document, and the Norwegian-speaking user could then access a French-Norwegian dictionary to find out what the marked section meant ๐Ÿ“–. If the user were listening to that document through a speech synthesis interface, this formation could be used to signal the synthesizer to apply French text-to-speech pronunciation rules to that span of text, instead of applying the inappropriate Norwegian rules ๐ŸŽงโœจ.

Language tags are related when they contain a similar sequence of subtags ๐Ÿ”—. For example, if a language tag B contains language tag A as a prefix, then B is typically "narrower" or "more specific" than A. Thus, zh-Hant-TW is more specific than zh-Hant ๐ŸŒŸ.

This relationship is NOT guaranteed in all cases: specifically, languages that begin with the same sequence of subtags are NOT guaranteed to be mutually intelligible, although they might be ๐Ÿ˜ฌ. For example, the tag az shares a prefix with both az-Latn (Azerbaijani written using the Latin script) and az-Cyrl (Azerbaijani written using the Cyrillic script). A person fluent in one script might not be able to read the other, even though the text might be identical. Content tagged as az most probably is written in just one script, and thus might not be intelligible to a reader familiar with the other script ๐Ÿ“œ.


4.3. Length Considerations ๐Ÿ“

[RFC3066] did not provide an upper limit on the size of language tags. While RFC 3066 did define the semantics of particular subtags in such a way that most language tags consisted of language and region subtags with a combined total length of up to six characters, larger registered tags were not only possible but were actually registered ๐Ÿฐ.

Neither the language tag syntax nor other requirements in this document impose a fixed upper limit on the number of subtags in a language tag (and thus an upper bound on the size of a tag) ๐Ÿ™Œ. The language tag syntax suggests that, depending on the specific language, more subtags (and thus a longer tag) are sometimes necessary to completely identify the language for certain applications. So yes, it's possible to envision long or complex subtag sequences ๐ŸŒˆ๐Ÿ’….

4.3.1. Working with Limited Buffer Sizes

okay bestie, some apps and protocols are stuck with fixed buffer sizes, or they just have to cap how long a language tag can get ๐Ÿ˜ญ. A conformant implementation or specification MAY refuse to support storing language tags that go over a specified length. Any limit like that SHOULD be clearly documented, and the docs SHOULD say what happens to longer tags (like whether an error value shows up or the tag gets truncated) ๐Ÿ“. A protocol that lets tags get chopped at some random limit, without telling anyone what the limit is, can totally mess up the meaning of tags in a big way ๐Ÿ’€.

Good news though: most language tags only have a few subtags and won't come anywhere near reasonable buffer limits โœจ. See Section 4.1 for more on that ๐ŸŽ€.

Some specs or protocols have limits on tag length but no fixed length limit. [RFC2231] is a good example ๐Ÿฆ‹. It has no explicit length limitation. Instead, the room left for the language tag depends on how long the other header parts are (like the charset's name), along with the 76-character limit in [RFC2047]. So the "limit" might be 50 or more characters, but it could honestly be pretty small ๐Ÿ™ˆ.

Here's what to keep in mind when picking a buffer limit:

  • Implementations SHOULD NOT truncate language tags unless the meaning of the tag is purposefully being changed, or unless the tag does not fit into a limited buffer size specified by a protocol for storage or transmission.
  • Implementations SHOULD warn the user when a tag is truncated, since truncation changes the semantic meaning of the tag ๐Ÿšจ.
  • Implementations of protocols or specifications that are space constrained but do not have a fixed limit SHOULD use the longest possible tag in preference to truncation ๐ŸŒธ.
  • Protocols or specifications that specify limited buffer sizes for language tags MUST allow for language tags of up to 33 characters ๐Ÿ‘‘.
  • Protocols or specifications that specify limited buffer sizes for language tags SHOULD allow for language tags of at least 42 characters ๐Ÿซถ.

So where does the 42-character recommendation come from? It's giving math ๐Ÿงฎ. The combination of language and extended language subtags was picked with future compatibility in mind. At up to 15 characters, that combo is longer than the longest possible primary language subtag (8 characters) โœจ.

   language      =  3 (ISO 639-2; ISO 639-1 requires 2)
   extlang1      =  4 (each subsequent subtag includes '-')
   extlang2      =  4 (unlikely: needs prefix="language-extlang1")
   extlang3      =  4 (extremely unlikely)
   script        =  5 (if not suppressed: see Section 4.1)
   region        =  4 (UN M.49; ISO 3166 requires 3)
   variant1      =  9 (MUST have language as a prefix)
   variant2      =  9 (MUST have language-variant1 as a prefix)

   total         = 42 characters

              Figure 7: Derivation of the Limit on Tag Length

4.3.2. Truncation of Language Tags

truncating a tag changes what it means, so it SHOULD be avoided ๐Ÿ™…โ€โ™€๏ธ. Sometimes it's unavoidable though, because buffers are tiny ๐Ÿ˜ฉ. Even then, truncation MUST NOT chop a subtag off in the middle, and it MUST NOT create invalid tags (like one ending with the "-" character) ๐Ÿ’….

So apps or protocols that truncate tags MUST do it by progressively removing subtags, along with their preceding "-", from the right side of the tag. Keep going until the tag fits in the buffer ๐Ÿงš. If the result ends with a single-character subtag, that subtag and its preceding "-" MUST also be removed too ๐Ÿ“. Here's an example:

   Tag to truncate: zh-Latn-CN-variant1-a-extend1-x-wadegile-private1
   1. zh-Latn-CN-variant1-a-extend1-x-wadegile
   2. zh-Latn-CN-variant1-a-extend1
   3. zh-Latn-CN-variant1
   4. zh-Latn-CN
   5. zh-Latn
   6. zh

                    Figure 8: Example of Tag Truncation

4.4. Canonicalization of Language Tags

since one language tag can get passed around and used by lots of different processes, language tags SHOULD always be created or generated in a canonical form ๐Ÿ’–.

A language tag is in canonical form when:

  1. The tag is well-formed according the rules in Section 2.1 and Section 2.2 โœ….
  2. Subtags of type 'Region' that have a Preferred-Value mapping in the IANA registry (see Section 3.1) SHOULD be replaced with their mapped value. Note: in rare cases, the mapped value will also have a Preferred-Value ๐ŸŒˆ.
  3. Redundant or grandfathered tags that have a Preferred-Value mapping in the IANA registry (see Section 3.1) MUST be replaced with their mapped value. These items are either deprecated mappings created before this document was adopted (like the mapping of "no-nyn" to "nn" or "i-klingon" to "tlh"), or they're the result of later registrations or additions to this document (for example, "zh-guoyu" might be mapped to a language-extlang combination such as "zh-cmn" by some future update of this document) ๐Ÿ•ฐ๏ธ.
  4. Other subtags that have a Preferred-Value mapping in the IANA registry (see Section 3.1) MUST be replaced with their mapped value. These items consist entirely of clerical corrections to ISO 639-1, where the deprecated subtags were kept around for compatibility purposes ๐Ÿ—‚๏ธ.
  5. If more than one extension subtag sequence exists, the extension sequences are ordered into case-insensitive ASCII order by singleton subtag ๐Ÿ”ค.

Example: The language tag "en-A-aaa-B-ccc-bbb-x-xyz" is in canonical form, while "en-B-ccc-bbb-A-aaa-X-xyz" is well-formed but not in canonical form ๐Ÿ‘€.

Example: The language tag "en-BU" (English as used in Burma) is not canonical, because the 'BU' subtag has a canonical mapping to 'MM' (Myanmar). The tag "en-BU" still keeps its validity though ๐Ÿซ .

Canonicalization doesn't say anything about whether you use upper or lowercase letters when processing or comparing subtags (see Section 2.1 for that) ๐Ÿ”ก. All comparisons MUST be performed in a case-insensitive manner ๐Ÿ™Œ.

When canonicalizing, processors MAY regularize the case of the subtags, following the case used in the registry. That makes this process OPTIONAL ๐ŸŽ€. The casing rules it corresponds to are: uppercase all non-initial two-letter subtags, titlecase all non-initial four-letter subtags, and lowercase everything else ๐Ÿ’œ.

Note: case folding of ASCII letters in certain locales, unless it's handled carefully, sometimes produces non-ASCII character values ๐Ÿ˜ฑ. The Unicode Character Database file "SpecialCasing.txt" defines the specific cases that are known to cause problems with this. The big one is the letter 'i' (U+0069) in Turkish and Azerbaijani, which gets uppercased to U+0130 (LATIN CAPITAL LETTER I WITH DOT ABOVE). Implementers SHOULD specify a locale-neutral casing operation so that case folding of subtags doesn't produce this value, since it's illegal in language tags ๐Ÿšซ. For example, if you uppercase the region subtag 'in' using Turkish locale rules, you get the sequence U+0130 U+004E instead of the expected 'IN' ๐Ÿ’€.
Note: if the field 'Deprecated' shows up in a registry record without an accompanying 'Preferred-Value' field, then that tag or subtag is deprecated with no replacement. Validating processors SHOULD NOT generate tags that include these values, although the values are canonical when they appear in a language tag ๐Ÿ›‘.

An extension MUST define any relationships that exist between the various subtags in the extension. It MAY also define an alternate canonicalization scheme for the extension's subtags ๐Ÿงฉ. Extensions MAY define how the order of their subtags is interpreted. For example, an extension could say its subtags are in canonical order when they're placed into ASCII order, so "en-a-aaa-bbb-ccc" instead of "en-a-ccc-bbb-aaa" ๐Ÿ”ข. Another extension might say the order of the subtags affects their semantic meaning, so "en-b-ccc-bbb-aaa" has a different value from "en-b-aaa-bbb-ccc" ๐ŸŒ€. Even so, extension specifications SHOULD be designed so they tolerate the typical processes described in Section 3.7 ๐Ÿซถ.

4.5. Considerations for Private Use Subtags

private use subtags are just like every other subtag, so they MUST conform to the format and content constraints in the ABNF ๐Ÿ“. They have no meaning outside the private agreement between the parties who intend to use or exchange language tags that include them ๐Ÿคซ. The same subtags MAY be used with a different meaning under a separate private agreement ๐Ÿ”. They SHOULD NOT be used where alternatives exist, and they SHOULD NOT be used in content or protocols meant for general use ๐Ÿ™…โ€โ™€๏ธ.

Honestly, private use subtags are pretty useless for information exchange without a prior arrangement ๐Ÿ˜…. The value and semantic meaning of private use tags, and of the subtags inside them, are not defined by this document ๐Ÿ“ญ.

Subtags that the IANA registry defines as having a specific private use meaning carry more information than a purely private use tag prefixed by the singleton subtag 'x' โœจ. For applications, that extra information MAY be useful ๐Ÿ’ก.

For example, the region subtags 'AA', 'ZZ', and the ranges 'QM'-'QZ' and 'XA'-'XZ' (derived from ISO 3166 private use codes) MAY be used to form a language tag ๐Ÿ—บ๏ธ. A tag like "zh-Hans-XQ" says a lot of public, interchangeable stuff about the language material. It's Chinese, in the simplified Chinese script, and suitable for some geographic region 'XQ' ๐Ÿ‡จ๐Ÿ‡ณ. The exact region isn't known outside the private agreement, but the tag still gives way more info than an opaque tag like "x-someLang", which tells you nothing about the language or script subtags outside that agreement ๐Ÿฅน.

That said, content tagged with private use subtags MAY interact with other systems in a different, and possibly unsuitable, way compared to tags using opaque, privately defined subtags ๐Ÿ™ˆ. So picking the best approach sometimes depends on the particular domain you're working in ๐ŸŽฏ.

5. IANA Considerations ๐Ÿ’…

This section covers the processes and requirements IANA needs to follow to maintain the subtag and extension registries defined by this document, in line with the requirements of [RFC2434] ๐Ÿ“‹.

The impact on the IANA maintainers of the two registries defined by this document will be a small increase in how often new entries or updates come in ๐Ÿ“ˆ.

5.1. Language Subtag Registry ๐ŸŽ€

okay so once this doc is adopted, the registry gets its starting records from a companion doc, [RFC4645] ๐Ÿ“š. That one explains the criteria and process for picking the initial set. honestly it's giving "someone else did the homework," because the initial set has no impact on IANA since the work to make it happens externally ๐Ÿงš

The new registry MUST be listed under "Language Tags" at <http://www.iana.org/numbers.html>, replacing the old registrations defined by [RFC3066] ๐Ÿ’… The existing registration forms and RFC 3066 registrations MUST be relabeled as "Language Tags (Obsolete)" and kept around, but nobody adds to or changes them anymore ๐Ÿ•ฐ๏ธ

Future work on the Language Subtag Registry SHALL be limited to inserting or replacing whole records. These records are preformatted for IANA by the Language Subtag Reviewer, as described in Section 3.3 of this document, and then you archive the forwarded registration form ๐Ÿ—‚๏ธ very strict, very organized, I'm obsessed.

Each record MUST be sent to iana@iana.org with a subject line saying whether it's an insertion of a new record (the word "INSERT" in the subject line) or a replacement of an existing record (the word "MODIFY" in the subject line) ๐Ÿ“ฌ Records MUST NOT be deleted from the registry. Ever. Iconic. IANA MUST place any inserted or modified records into the appropriate section of the language subtag registry, grouping them by their 'Type' field ๐ŸŒธ Inserted records MAY be placed anywhere in that section. There is no guarantee of the order of the records beyond grouping them together by 'Type' ๐Ÿคทโ€โ™€๏ธ Modified records MUST overwrite the record they replace โœจ

Any request to insert or modify records MUST include a new File-Date record ๐Ÿ“… This record MUST be placed first in the registry. If the File-Date record already in the registry has a later date than the record being inserted or modified, the existing record MUST be preserved ๐Ÿซถ no overwriting the newer vibes.

5.2. Extensions Registry ๐Ÿฆ‹

The Language Tag Extensions Registry will also be generated and sent to IANA, as described in Section 3.7 ๐Ÿง This registry can contain at most 35 records, so changes to it are expected to be very infrequent ๐ŸŒ™

Future work by IANA on the Language Tag Extensions Registry is limited to two cases. First, the IESG MAY request that new records be inserted into this registry from time to time. These requests MUST include the record to insert, in the exact format described in Section 3.7 ๐Ÿ“ Second, there MAY be occasional requests from the maintaining authority for a specific extension to update the contact information or URLs in its record. These requests MUST include the complete, updated record ๐Ÿ’œ IANA is not responsible for validating the information provided, only that it is properly formatted. It should reasonably be seen to come from the maintaining authority named in the record already present in the registry ๐Ÿ”


6. Security Considerations ๐Ÿ”

Language tags used in content negotiation, like any other information exchanged on the Internet, might be a source of concern ๐Ÿ˜ญ because they might be used to infer the nationality of the sender, and thus identify potential targets for surveillance. yikes, literally a privacy moment ๐Ÿ™ˆ

This is a special case of the general problem that anything sent is visible to the receiving party and possibly to third parties as well ๐Ÿ‘€ It's useful to be aware that such concerns can exist in some cases.

The evaluation of the exact magnitude of the threat, and any possible countermeasures, is left to each application protocol (see BCP 72 [RFC3552] for best current practice guidance on security threats and defenses). so each protocol has to do its own threat homework ๐Ÿ’…

The language tag associated with a particular information item is of no consequence whatsoever in determining whether that content might contain possible homographs. The fact that a text is tagged as being in one language or using a particular script subtag provides no assurance whatsoever that it does not contain characters from scripts other than the one(s) associated with or specified by that language tag. ๐Ÿšจ a tag is NOT a homograph detector, bestie. don't trust it for that.

Since there is no limit to the number of variant, private use, and extension subtags, and consequently no limit on the possible length of a tag, implementations need to guard against buffer overflow attacks ๐Ÿ’€ See Section 4.3 for details on language tag truncation, which can occur as a consequence of defenses against buffer overflow ๐Ÿ›ก๏ธ

Although the specification of valid subtags for an extension (see Section 3.7) MUST be available over the Internet, implementations SHOULD NOT mechanically depend on it being always accessible, to prevent denial-of-service attacks ๐ŸŒˆ so it has to be out there, but don't hard-code your life around it being reachable 24/7.


7. Character Set Considerations ๐Ÿ”ค

The syntax in this document requires that language tags use only the characters A-Z, a-z, 0-9, and HYPHEN-MINUS, which are present in most character sets, so the composition of language tags should not have any character set issues ๐Ÿงšโ€โ™€๏ธ โœจ

Rendering of characters based on the content of a language tag is not addressed in this memo. Historically, some languages have relied on the use of specific character sets or other information in order to infer how a specific character should be rendered (notably this applies to language- and culture-specific variations of Han ideographs as used in Japanese, Chinese, and Korean) ๐Ÿ‡ฏ๐Ÿ‡ต๐Ÿ‡จ๐Ÿ‡ณ๐Ÿ‡ฐ๐Ÿ‡ท When language tags are applied to spans of text, rendering engines sometimes use that information in deciding which font to use in the absence of other information, particularly where languages with distinct writing traditions use the same characters ๐Ÿ“ same characters, different vibes, fr fr.

8. Changes from RFC 3066 ๐Ÿฆ‹

okay so this is the glow-up section ๐Ÿ’… the main goals for this revision of language tags were:

  • Compatibility. bestie, every RFC 3066 language tag (including the ones in the IANA registry) is still valid here ๐Ÿ’–. The changes in this document are extra constraints, so the syntax is never more permissive. That means processors built on the ABNF and other provisions of RFC 3066 (like the ones described in [XMLSchema]) will still be able to process the tags described by this document ๐Ÿซถ. This document also defines language tags in such a way as to ensure future compatibility โœจ.
  • Stability. the underlying ISO standards have changed in the past, so a valid RFC 3066 language tag could become invalid or have its meaning change ๐Ÿ˜ญ. That could wreck content with a super long shelf-life. In this specification, once a language tag is valid, it stays valid forever ๐Ÿ”’๐Ÿ’œ.
  • Validity. the structure of language tags defined here lets you check whether a tag is well-formed without caring about the actual content or "meaning" of the whole tag ๐Ÿงฉ. This matters because the registry grows and underlying standards change over time. It also must be possible to determine if a tag is valid (or not) for a given point in time, so results are reproducible and testable ๐Ÿ“…. This process must not be error-prone, otherwise implementations might give different results ๐Ÿ™ˆ. With an authoritative registry that has specific versioning information, validity at any point in time can be pinned down exactly, instead of stitching values together from many separate sources ๐Ÿ‘‘.
  • Utility. sometimes you really need to tell apart written forms of a language, and for lots of implementations that matters more than telling apart spoken variants ๐Ÿ“–. Languages are written in a wild range of scripts, so this document allows the generative use of ISO 15924 script codes ๐ŸŒˆ. Like the generative use of ISO language and country codes in RFC 3066, this lets you make combinations without going through the registration process ๐Ÿ“. The addition of UN M.49 codes gives you tags with regional scope, which some applications need too ๐ŸŒ.

The recast of the registry from whole language tags to subtags is a huge part of this ๐Ÿ”ฅ. An important feature of RFC 3066 was that it allowed generative use of subtags. That means people can use generated tags in a meaningful way, without waiting on registration delays or registering every combo that might be useful ๐Ÿ™Œ.


The placement of the extended language and script subtags between the primary language and region subtags was widely debated ๐Ÿ‘€. This design was chosen because the prevalent matching and content negotiation schemes rely on subtags being arranged in order of increasing specificity. In other words, the subtags that mark a greater barrier to mutual intelligibility sit left-most in a tag โœจ. For example, when you're selecting content written in Azerbaijani, the script (Arabic, Cyrillic, or Latin) is a bigger barrier to understanding than any regional variations (like the ones associated with Azerbaijan or Iran) ๐Ÿงฟ. So people who prefer documents in a particular script, but can handle the minor regional differences, can pick the right content ๐Ÿ’…. Applications that don't deal with written content will keep omitting these subtags ๐ŸŒธ.

  • Extensibility. okay this one is so important ๐Ÿงš. Because language tags are used everywhere, periodic revisions of the core specification are super disruptive, even when there's a demonstrated need. The extension mechanism gives independent RFCs a way to define extensions to language tags. These extensions have a very constrained, well-defined structure, which stops them from interfering with implementations of the language tags defined in this document ๐Ÿ›ก๏ธ.

The document also anticipates features of ISO 639-3 with the addition of the extended language subtags, and the possibility that other ISO 639 parts become useful for forming language tags in the future ๐Ÿ”ฎ.

The use and definition of private use tags were also modified ๐ŸŽ€. This lets people use private use subtags to extend or modify defined tags, and to move as much information as possible out of private use and into the regular structure ๐Ÿ’œ.

The goal for each of these modifications is to reduce or eliminate the need for future revisions of this document ๐Ÿซถ.

The specific changes in this document to meet these goals are:

  • Defines the ABNF and rules for subtags so that the category of all subtags can be determined without reference to the registry ๐Ÿ“.
  • Adds the concept of well-formed vs. validating processors, defining the rules by which an implementation can claim to be one or the other ๐Ÿง.
  • Replaces the IANA language tag registry with a language subtag registry that provides a complete list of valid subtags in the IANA registry. This allows for robust implementation and ease of maintenance ๐Ÿ› ๏ธ. The language subtag registry becomes the canonical source for forming language tags ๐Ÿ‘‘.
  • Provides a process that guarantees stability of language tags, by handling reuse of values by ISO 639, ISO 15924, and ISO 3166 in the event that they register a previously used value for a new purpose ๐Ÿ”’.
  • Allows ISO 15924 script code subtags and allows them to be used generatively. Defines a method for indicating in the registry when script subtags are necessary for a given language tag ๐ŸŒˆ.
  • Adds the concept of a variant subtag and allows variants to be used generatively ๐Ÿ“.
  • Adds the ability to use a class of UN M.49 tags for supra-national regions, and to resolve conflicts in the assignment of ISO 3166 codes ๐ŸŒ.
  • Defines the private use tags in ISO 639, ISO 15924, and ISO 3166 as the mechanism for creating private use language, script, and region subtags, respectively ๐ŸŽ€.
  • Adds a well-defined extension mechanism ๐Ÿงฉ.
  • Defines an extended language subtag, possibly for use with certain anticipated features of ISO 639-3 ๐Ÿฆ‹.

9. References ๐Ÿ“š

9.1. Normative References

  • [ISO10646] International Organization for Standardization, "ISO/IEC 10646:2003. Information technology -- Universal Multiple-Octet Coded Character Set (UCS)", 2003.
  • [ISO15924] International Organization for Standardization, "ISO 15924:2004. Information and documentation -- Codes for the representation of names of scripts", January 2004.
  • [ISO3166-1] International Organization for Standardization, "ISO 3166-1:1997. Codes for the representation of names of countries and their subdivisions -- Part 1: Country codes", 1997.
  • [ISO639-1] International Organization for Standardization, "ISO 639-1:2002. Codes for the representation of names of languages -- Part 1: Alpha-2 code", 2002.
  • [ISO639-2] International Organization for Standardization, "ISO 639-2:1998. Codes for the representation of names of languages -- Part 2: Alpha-3 code, first edition", 1998.
  • [ISO646] International Organization for Standardization, "ISO/IEC 646:1991, Information technology -- ISO 7-bit coded character set for information interchange.", 1991.
  • [RFC2026] Bradner, S., "The Internet Standards Process -- Revision 3", BCP 9, RFC 2026, October 1996.
  • [RFC2028] Hovey, R. and S. Bradner, "The Organizations Involved in the IETF Standards Process", BCP 11, RFC 2028, October 1996.
  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
  • [RFC2860] Carpenter, B., Baker, F., and M. Roberts, "Memorandum of Understanding Concerning the Technical Work of the Internet Assigned Numbers Authority", RFC 2860, June 2000.
  • [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002.
  • [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 4234, October 2005.
  • [UN_M.49] Statistics Division, United Nations, "Standard Country or Area Codes for Statistical Use", UN Standard Country or Area Codes for Statistical Use, Revision 4 (United Nations publication, Sales No. 98.XVII.9, June 1999.

9.2. Informative References

  • [RFC1766] Alvestrand, H., "Tags for the Identification of Languages", RFC 1766, March 1995.
  • [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text", RFC 2047, November 1996.
  • [RFC2231] Freed, N. and K. Moore, "MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations", RFC 2231, November 1997.
  • [RFC2781] Hoffman, P. and F. Yergeau, "UTF-16, an encoding of ISO 10646", RFC 2781, February 2000.
  • [RFC3066] Alvestrand, H., "Tags for the Identification of Languages", BCP 47, RFC 3066, January 2001.
  • [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on Security Considerations", BCP 72, RFC 3552, July 2003.
  • [RFC4645] Ewell, D., Ed., "Initial Language Subtag Registry", RFC 4645, September 2006.
  • [RFC4647] Phillips, A., Ed. and M. Davis, Ed., "Matching of Language Tags", BCP 47, RFC 4647, September 2006.
  • [Unicode] Unicode Consortium, "The Unicode Standard, Version 5.0", Boston, MA, Addison-Wesley, 2007. ISBN 0-321-48091-0.
  • [XML10] Bray (et al), T., "Extensible Markup Language (XML) 1.0", 02 2004.
  • [XMLSchema] Biron, P., Ed. and A. Malhotra, Ed., "XML Schema Part 2: Datatypes Second Edition", 10 2004, <http://www.w3.org/TR/xmlschema-2/>.
  • [iso639.prin] ISO 639 Joint Advisory Committee, "ISO 639 Joint Advisory Committee: Working principles for ISO 639 maintenance", March 2000, <http://www.loc.gov/standards/iso639-2/iso639jac_n3r.html>.
  • [record-jar] Raymond, E., "The Art of Unix Programming", 2003, <urn:isbn:0-13-142901-9>.

Appendix A. Acknowledgements ๐Ÿ’–

okay bestie, the people list ๐Ÿฅน any list of contributors is gonna be incomplete, so just know this is only a selection of everyone who helped make this doc what it is today โœจ

the folks behind RFC 3066 and RFC 1766, the older versions of this doc, did SO much work, directly or indirectly, and honestly they're the reason language tags are a whole thing that works ๐Ÿ‘‘

the following people (in alphabetical order) contributed to this document or to RFCs 1766 and 3066: Glenn Adams, Harald Tveit Alvestrand, Tim Berners-Lee, Marc Blanchet, Nathaniel Borenstein, Karen Broome, Eric Brunner, Sean M. Burke, M.T. Carrasco Benitez, Jeremy Carroll, John Clews, Jim Conklin, Peter Constable, John Cowan, Mark Crispin, Dave Crocker, Elwyn Davies, Martin Duerst, Frank Ellerman, Michael Everson, Doug Ewell, Ned Freed, Tim Goodwin, Dirk-Willem van Gulik, Marion Gunn, Joel Halpren, Elliotte Rusty Harold, Paul Hoffman, Scott Hollenbeck, Richard Ishida, Olle Jarnefors, Kent Karlsson, John Klensin, Erkki Kolehmainen, Alain LaBonte, Eric Mader, Ira McDonald, Keith Moore, Chris Newman, Masataka Ohta, Dylan Pierce, Randy Presuhn, George Rhoten, Felix Sasaki, Markus Scherer, Keld Jorn Simonsen, Thierry Sourbier, Otto Stolz, Tex Texin, Andrea Vine, Rhys Weatherley, Misha Wolf, Francois Yergeau and many, many others ๐Ÿซถ

very special thanks go to Harald Tveit Alvestrand, who originated RFCs 1766 and 3066, and without whom this document would not have been possible ๐Ÿ˜ญ special thanks also to Michael Everson, who has served as Language Tag Reviewer for almost the complete period since RFC 1766 was published ๐ŸŒธ and to Doug Ewell, for producing the first complete subtag registry and for his work on a test parser for verifying language tags ๐Ÿ’…

Appendix B. Examples of Language Tags (Informative) ๐ŸŒˆ

here's the examples drawer, the best part for seeing how the tags actually look in real life ๐Ÿงš

Simple language subtag

de (German)

fr (French)

ja (Japanese)

i-enochian (example of a grandfathered tag)

Language subtag plus Script subtag

zh-Hant (Chinese written using the Traditional Chinese script)

zh-Hans (Chinese written using the Simplified Chinese script)

sr-Cyrl (Serbian written using the Cyrillic script)

sr-Latn (Serbian written using the Latin script)

Language-Script-Region

zh-Hans-CN (Chinese written using the Simplified script as used in
mainland China)

sr-Latn-CS (Serbian written using the Latin script as used in
Serbia and Montenegro)

Language-Variant

sl-rozaj (Resian dialect of Slovenian

sl-nedis (Nadiza dialect of Slovenian)

Language-Region-Variant

de-CH-1901 (German as used in Switzerland using the 1901 variant
[orthography])

sl-IT-nedis (Slovenian as used in Italy, Nadiza dialect)

Language-Script-Region-Variant

sl-Latn-IT-nedis (Nadiza dialect of Slovenian written using the
Latin script as used in Italy.  Note that this tag is NOT
RECOMMENDED because subtag 'sl' has a Suppress-Script value of
'Latn')

Language-Region

de-DE (German for Germany)

en-US (English as used in the United States)

es-419 (Spanish appropriate for the Latin America and Caribbean
region using the UN region code)

Private use subtags

de-CH-x-phonebk

az-Arab-x-AZE-derbend

Extended language subtags

examples ONLY: extended languages MUST be defined by revision or update to this document ๐Ÿ™ˆ

zh-min

zh-min-nan-Hant-CN

Private use registry values

x-whatever (private use using the singleton 'x')

qaa-Qaaa-QM-x-southern (all private tags)

de-Qaaa (German, with a private script)

sr-Latn-QM (Serbian, Latin-script, private region)

sr-Qaaa-CS (Serbian, private script, for Serbia and Montenegro)

Tags that use extensions

examples ONLY: extensions MUST be defined by revision or update to this document or by RFC ๐Ÿงฉ

en-US-u-islamCal

zh-CN-a-myExt-x-private
en-a-myExt-b-another

Some Invalid Tags

these ones are NOT valid, so don't copy them ๐Ÿ’€

de-419-DE (two region tags)

a-DE (use of a single-character subtag in primary position; note
that there are a few grandfathered tags that start with "i-" that
are valid)

ar-a-aaa-b-bbb-a-ccc (two extensions with same single-letter
prefix)

Authors' Addresses ๐Ÿฆ‹

Addison Phillips (Editor) Yahoo! Inc.

EMail: addison@inter-locale.com

Mark Davis (Editor) Google

EMail: mark.davis@macchiato.com or mark.davis@google.com

Copyright (C) The Internet Society (2006).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property โš–๏ธ

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.

Acknowledgement ๐Ÿซถ

Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA). and that's a wrap on the whole doc, bestie!! ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from