BCP 47IETF language tagslanguage subtagsISO 639ISO 15924

IETF BCP 47 Language Tags: The Standard for Internet Language Identification

IETF BCP 47 Language Tags: The Standard for Internet Language Identification In the vast landscape of the internet, communicating which language a piece of content is written in is essent...

IETF BCP 47 Language Tags: The Standard for Internet Language Identification

In the vast landscape of the internet, communicating which language a piece of content is written in is essential for usability and accessibility. This is achieved through IETF BCP 47 language tags, a standardized system of codes used to identify human languages across various digital platforms. These tags are defined by the Internet Engineering Task Force (IETF) under Best Current Practice (BCP) 47, with the specific components, known as subtags, maintained by the IANA Language Subtag Registry.

Whether you are browsing a website, reading an XML file, or viewing a PNG image, these tags work behind the scenes to ensure that computing standards like HTTP, HTML, and XML can correctly interpret and present linguistic information.

Key Facts

  • Standardization: Managed by the IETF and maintained via the IANA Language Subtag Registry.
  • Core Components: Composed of subtags representing language, script, and region.
  • Interoperability: Integrates multiple international standards including ISO 639, ISO 15924, ISO 3166-1, and UN M.49.
  • Stability: Once a subtag is defined, it retains its meaning even if the underlying ISO standard changes or withdraws a code.
  • Common Uses: Essential for HTTP, HTML, XML, and PNG protocols.

The Structure of a Language Tag

A language tag is not just a single code; it is a combination of subtags that provide specific details about a language. By combining different standards, BCP 47 can distinguish between subtle linguistic variations, such as different writing systems or regional dialects.

Primary Language Subtags

The foundation of any tag is the primary language subtag. This is typically a two-letter code from ISO 639-1 or a three-letter code from ISO 639-2, 639-3, or 639-5. For example, en represents English, while zh represents Chinese.

Script and Region Subtags

To add precision, developers can include optional subtags:

  • Script Subtags: Based on ISO 15924, these identify the writing system. For instance, sr-Cyrl specifies Serbian written in the Cyrillic script.
  • Region Subtags: Based on ISO 3166-1 (two-letter country codes) or UN M.49 (three-digit geographical codes), these identify specific locations. An example is es-419, which denotes Spanish as spoken in Latin America.

Complex combinations allow for extreme specificity, such as nan-Hant-TW, which identifies Min Nan Chinese using traditional Han characters as spoken in Taiwan.

Examples of BCP 47 Language Tag Variations
Language Name Native Name Subtag Details
English English en Standard English
Spanish español es-419 Latin American Spanish
Serbian српски sr-Cyrl Serbian in Cyrillic script
Cantonese 粵語 yue-Hant-HK Cantonese in traditional characters (Hong Kong)
German Deutsch gsw-u-sd-chzh Zürich German with specific extensions

Evolution and History

The BCP 47 standard has evolved significantly since its inception. It was first defined in RFC 1766 in March 1995, edited by Harald Tveit Alvestrand. Early versions relied heavily on two-letter ISO 639 and ISO 3166 codes.

Over the decades, several key updates have refined the system:

  • 2001 (RFC 3066): Introduced three-letter ISO 639-2 codes and the concept of language ranges for HTTP/1.1.
  • 2006 (RFC 4646 & 4647): Introduced a more structured format, added four-letter script codes (ISO 15924), and implemented the subtag registry system.
  • 2009 (RFC 5646): The current version, which incorporated ISO 639-3 and 639-5 to improve interoperability.

Relationship with Other Standards

While BCP 47 draws from core standards like ISO and UN, it prioritizes stability. If an ISO standard reassigns a code, the BCP 47 subtag retains its original meaning to prevent breaking existing digital implementations. This ensures that a tag used in a website today will still mean the same thing years from now.

Handling Language Collections and Scripts

The system also manages language collections (groups of related languages) via ISO 639-5. However, because these collections can sometimes be ambiguous (inclusive vs. exclusive), RFC 5646 generally recommends using specific language subtags for most applications. Similarly, script subtags help distinguish between orthographic differences, such as the simplified (Hans) and traditional (Hant) forms of Chinese characters.

Advanced Extensions

Beyond basic language, script, and region, BCP 47 supports specialized extensions:

  • Extension T (Transformed Content): Managed by the Unicode Consortium to handle content transformations.
  • Extension U (Unicode Locale): Allows for specific formatting attributes, such as ar-u-nu-latn, which specifies Arabic language content using Basic Latin digits (0-9) instead of Arabic-script digits.

Frequently Asked Questions

What is the difference between a language and a script subtag?

A language subtag identifies the spoken or written tongue (e.g., English), while a script subtag identifies the specific writing system used (e.g., Cyrillic or Latin).

Why does BCP 47 not change when ISO codes change?

To maintain stability in computing, BCP 47 is designed so that once a subtag is registered, it keeps its meaning. This prevents software from misinterpreting content if an international standard reassigns a code.

What are "private-use" subtags?

Private-use subtags are not listed in the official IANA Registry because they are used for specific, private agreements between third parties and are not part of the public BCP 47 scope.

How are sign languages identified in BCP 47?

Sign languages are registered as extended language subtags (extlangs) using the sgn prefix, such as ase for American Sign Language.

What is the role of the Unicode Consortium in BCP 47?

The Unicode Consortium acts as the Registration Authority for specific extensions, such as Extension T and Extension U, which deal with transformed content and Unicode locale attributes.