l10n.lang.value.rfc.compliant.xml 2.4 KB

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