1 <refentry xmlns="http://docbook.org/ns/docbook"
\r
2 xmlns:xlink="http://www.w3.org/1999/xlink"
\r
3 xmlns:xi="http://www.w3.org/2001/XInclude"
\r
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
\r
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
\r
6 version="5.0" xml:id="l10n.lang.value.rfc.compliant">
\r
8 <refentrytitle>l10n.lang.value.rfc.compliant</refentrytitle>
\r
9 <refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
\r
12 <refname>l10n.lang.value.rfc.compliant</refname>
\r
13 <refpurpose>Make value of lang attribute RFC compliant?</refpurpose>
\r
17 <src:fragment xml:id="l10n.lang.value.rfc.compliant.frag">
\r
18 <xsl:param name="l10n.lang.value.rfc.compliant" select="1"/>
\r
22 <refsection><info><title>Description</title></info>
\r
24 <para>If non-zero, ensure that the values for all <tag class="attribute">lang</tag> attributes in HTML output are RFC
\r
25 compliant<footnote><para>Section 8.1.1, <link xlink:href="http://www.w3.org/TR/REC-html40/struct/dirlang.html#h-8.1.1">Language Codes</link>, in the HTML 4.0 Recommendation states that:
\r
27 <blockquote><para>[RFC1766] defines and explains the language codes
\r
28 that must be used in HTML documents.</para>
\r
29 <para>Briefly, language codes consist of a primary code and a possibly
\r
30 empty series of subcodes:
\r
32 <literallayout class="monospaced">language-code = primary-code ( "-" subcode )*</literallayout>
\r
34 <para>And in RFC 1766, <link xlink:href="http://www.ietf.org/rfc/rfc1766.txt">Tags for the Identification
\r
35 of Languages</link>, the EBNF for "language tag" is given as:
\r
37 <literallayout class="monospaced">Language-Tag = Primary-tag *( "-" Subtag )
\r
38 Primary-tag = 1*8ALPHA
\r
39 Subtag = 1*8ALPHA</literallayout>
\r
44 by taking any underscore characters in any <tag class="attribute">lang</tag> values found in source documents, and
\r
45 replacing them with hyphen characters in output HTML files. For
\r
46 example, <literal>zh_CN</literal> in a source document becomes
\r
47 <literal>zh-CN</literal> in the HTML output form that source.
\r
50 <para>This parameter does not cause any case change in <tag class="attribute">lang</tag> values, because RFC 1766
\r
51 explicitly states that all "language tags" (as it calls them) "are
\r
52 to be treated as case insensitive".</para>
\r