Language Tag
The vocabulary for BCP 47 language tags and the subtags they are built from — the schema behind the generated `language-tags` code list. A LanguageTag is a complete tag that can label text in a language; a Subtag is a registered building block (a script, a region, a variant). A primary language subtag is both.
BCP 47 identifies a language with a tag such as en, zh-Hant or sl-rozaj, composed from registered subtags: a primary language, optionally an extended language, a script, a region and variants. The IANA Language Subtag Registry is the source of truth for the subtags and for a small set of whole tags registered before the grammar settled (grandfathered) or registered redundantly. The language-tags package at codes.kanonak.org is that registry projected into Kanonak by its producer; this package is the schema the projection is typed with.
The two classes to know are Language Tag — anything that can stand as a complete tag, and therefore anything a language-tagged string may point at — and
Subtag — a registered component. A
Language Subtag is both, so
en alone is a valid tag. A Script Subtag such as
Hant, a Region Subtag such as
US or 001, an Extended Language Subtag and a
Variant Subtag are components only.
Grandfathered Tag and
Redundant Tag are the registry's whole-tag entries. Because the registry holds subtags, not the tags people compose from them, a document that needs
zh-Hant-TW declares it in its own package as a LanguageTag composed via Primary Language,
Script and
Region from the registry's entries — the composition is validated, and the registry stays a finite list.
Lifecycle follows the code-lists floor: a retired entry carries owl.deprecated and Deprecated On, and the registry's preferred value becomes
prov.supersededBy on the entry — so a validator can say "iw is deprecated; use he" with a real reference, not a string.