Language Codes
The value of the xml:lang
language attribute should be one of the two-letter
language codes defined in ISO-639, “Codes for the Representation of
Names of Languages,” found at http://lcweb.loc.gov/standards/iso639-2/langhome.html,
if such a code exists for the language in question.
For languages that aren’t listed in ISO-639, you can use a
language identifier registered with IANA; currently, about 20 of
these identifiers exist, including i-navajo, i-klingon, and i-lux. The complete list can be found at
ftp://ftp.isi.edu/in-notes/iana/assignments/languages.
All identifiers begin with i-.
For example:
<maxim xml:lang="i-klingon">Heghlu'meH QaQ jajvam</maxim>
If the language you need still isn’t present in these two
lists, you can create your own language tag, as long as it begins
with the prefix x- or X- to identify it as a user-defined
language code. For example, the title of this journal is written in
J. R. R. Tolkien’s fictional Quenya language:
<journal xml:lang="x-quenya">Tyalië Tyelelliéva</journal>
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access