The set of tags constructed according to RFC 5646 for the identification of languages.
RFC 5646 obsoletes RFC 4646.
Most people meet RFC 5646 without knowing its number: it is the rulebook for the lang="fr" attribute in HTML, for the Accept-Language header a browser sends, and for xml:lang in XML. In Dublin Core, dcterms:RFC5646 is the syntax encoding scheme that declares a value of dcterms:language to be such a tag. Its official comment states that it obsoletes RFC 4646.
How a tag is put together
A tag is a sequence of subtags joined by hyphens, each in a fixed position:
language - extlang - script - region - variant - extension - privateuse
Only the language subtag is required, and most real tags use one or two more. de is German. de-CH is German as used in Switzerland. zh-Hant-HK is Chinese in traditional script as used in Hong Kong. sl-rozaj uses a variant subtag for the Resian dialect of Slovenian. x- starts a private-use section that only means something by local agreement.
Every subtag except the extension and private-use parts has to appear in the IANA Language Subtag Registry. That registry is the practical reference: it is a single text file, updated as ISO 639, ISO 15924 and ISO 3166 change, and it records deprecated subtags along with their preferred values.
What RFC 5646 changed
RFC 5646 kept existing well-formed tags valid and widened what could go in them. It brought the full set of ISO 639-3 individual language codes and the ISO 639-5 collection codes into the registry, so that a tag can name, say, yue for Cantonese directly. It also introduced extended language subtags, a compatibility device that allows forms such as zh-yue, although the registry marks the shorter form as preferred. The older scheme dcterms:RFC4646 explains the structure that RFC 5646 inherited.
Matching is handled separately, in RFC 4647. It defines how a request for de should match content tagged de-AT, and how a list of preferences falls back from one tag to the next. Metadata rarely needs those rules directly, but discovery interfaces that filter by language do, and they explain why tagging too specifically can hide records from a broad search.
Choosing the right tag for a record
The guiding principle in BCP 47 is to tag as specifically as the content requires, and no more. A few practical cases:
| Resource | Sensible tag | Why |
|---|---|---|
| English-language PDF report | en |
region adds nothing |
| Brazilian Portuguese subtitles | pt-BR |
spelling and vocabulary differ from pt-PT |
| Serbian text in Cyrillic | sr-Cyrl |
script decides rendering and search |
| Spanish dubbing for Latin American markets | es-419 |
covers many countries at once |
| Mandarin audio interview | cmn or zh |
depends on local policy |
The last row is where policies diverge. zh is widely recognized; cmn is precise for spoken Mandarin. For audio and video, where the spoken variety is the content, the specific subtag is usually the better record, and the macrolanguage can be added in a second statement if search needs it.
Region subtags draw on ISO 3166-1 for countries. Three-letter language codes without any other subtag can be typed with dcterms:ISO639-3 as an alternative.
Validation problems seen in practice
Validators most often flag:
en_GB, with an underscore copied from a software locale.en-UK; the region code for the United Kingdom isGB.jpfor Japanese, where the language subtag isja(JPis the region).- Deprecated subtags like
iwfor Hebrew, nowhe.
Tags compare case-insensitively, so EN-gb is technically equal to en-GB. Normalizing case on ingest still saves trouble in systems that compare strings literally, which includes many faceted search indexes. A one-time normalization step on import, applying the registry’s recommended case, is enough to fix it.
Example in RDF
<rdf:Description rdf:about="https://example.org/subtitles/doc-film-22.vtt"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/">
<dcterms:language rdf:datatype="http://purl.org/dc/terms/RFC5646">es-419</dcterms:language>
</rdf:Description>
Questions about dcterms:RFC5646
What is RFC 5646?
RFC 5646 is the IETF document, published in September 2009, that defines how language tags are built and matched. It is the current text behind BCP 47, together with RFC 4647 on matching. HTML lang attributes, HTTP headers and xml:lang all follow it.
What is the relationship between RFC 5646 and BCP 47?
BCP 47 is a stable label for the current best practice on language tags. Its content is the pair RFC 5646 and RFC 4647. Citing BCP 47 means the latest rules even if a future RFC replaces 5646.
What does es-419 mean?
It is Spanish as used in Latin America and the Caribbean. The region subtag 419 is a UN M49 numeric code. Region subtags can be ISO 3166-1 alpha-2 codes or M49 numbers for areas that cover several countries.
What did RFC 5646 add over RFC 4646?
It added extended language subtags, aligned the registry with ISO 639-3 and ISO 639-5 so that thousands of individual languages and language collections became valid primary subtags, and refined the registry's maintenance rules.
Which tag should I use for English?
Plain 'en' is right unless the variety matters. Use 'en-GB' or 'en-US' for spelling-sensitive text such as a dictionary or a transcription. Adding a region to every tag by default adds noise and makes matching harder.