29 lines
1.6 KiB
XML
29 lines
1.6 KiB
XML
<page title="What are they?">
|
|
<p><em>Language tags</em> are a way to <em>tag</em> digital resources
|
|
to indicate in what <wikipedia name="language">human
|
|
language</wikipedia> they are. They are also used by software to tell
|
|
an user's preference about languages.</p>
|
|
<p>They can express the language itself but also the writing system,
|
|
the national variant and many other things.</p>
|
|
<p>A few examples of language tags:</p>
|
|
<ul>
|
|
<li><code>fr</code>: <wikipedia name="French language">French</wikipedia> language,</li>
|
|
<li><code>en-AU</code>: <wikipedia name="English language">English</wikipedia> language, as
|
|
written and spoken in <wikipedia>Australia</wikipedia>,</li>
|
|
<li><code>az-Latn-IR</code>, <wikipedia name="Azerbaijani language">Azeri</wikipedia> language,
|
|
written in the <wikipedia name="Latin alphabet">Latin</wikipedia> script, as used in <wikipedia>Iran</wikipedia>.</li>
|
|
</ul>
|
|
<p>They are specified in <wikipedia>IETF</wikipedia>
|
|
<wikipedia name="Request for Comments">RFC</wikipedia> <em>5646</em> (<a
|
|
href="http://www.rfc-editor.org/rfc/rfc5646.txt">available
|
|
online</a>).</p>
|
|
<p>Language tags are made of <em>subtags</em> separated by
|
|
hyphens. The list of possible subtags is mostly directly copied from
|
|
various <wikipedia>ISO</wikipedia> standards such as <wikipedia name="ISO
|
|
639">ISO 639</wikipedia>.</p>
|
|
<p>They are used in many formats and protocols for instance in
|
|
<wikipedia>XML</wikipedia> (through the <code>xml:lang</code>
|
|
attribute) and in <wikipedia>HTTP</wikipedia> (the browser can
|
|
indicate to the <wikipedia>Web</wikipedia> server what language the
|
|
user prefers, should the Web server have several versions).</p>
|
|
</page> |