olink.lang.fallback.sequence.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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="olink.lang.fallback.sequence">
  7. <refmeta>
  8. <refentrytitle>olink.lang.fallback.sequence</refentrytitle>
  9. <refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
  10. </refmeta>
  11. <refnamediv>
  12. <refname>olink.lang.fallback.sequence</refname>
  13. <refpurpose>look up translated documents if olink not found?</refpurpose>
  14. </refnamediv>
  15. <refsynopsisdiv> <src:fragment xml:id="olink.lang.fallback.sequence.frag">
  16. <xsl:param name="olink.lang.fallback.sequence"></xsl:param>
  17. </src:fragment>
  18. </refsynopsisdiv>
  19. <refsection><info><title>Description</title></info>
  20. <para>This parameter defines a list of lang values
  21. to search among to resolve olinks.
  22. </para>
  23. <para>Normally an olink tries to resolve to a document in the same
  24. language as the olink itself. The language of an olink
  25. is determined by its nearest ancestor element with a
  26. <tag class="attribute">lang</tag> attribute, otherwise the
  27. value of the <parameter>l10n.gentext.default.lang</parameter>
  28. parameter.
  29. </para>
  30. <para>An olink database can contain target data for the same
  31. document in multiple languages. Each set of data has the
  32. same value for the <tag>targetdoc</tag> attribute in
  33. the <tag>document</tag> element in the database, but with a
  34. different <tag>lang</tag> attribute value.
  35. </para>
  36. <para>When an olink is being resolved, the target is first
  37. sought in the document with the same language as the olink.
  38. If no match is found there, then this parameter is consulted
  39. for additional languages to try.</para>
  40. <para>The <parameter>olink.lang.fallback.sequence</parameter>
  41. must be a whitespace separated list of lang values to
  42. try. The first one with a match in the olink database is used.
  43. The default value is empty.</para>
  44. <para>For example, a document might be written in German
  45. and contain an olink with
  46. <literal>targetdoc="adminguide"</literal>.
  47. When the document is processed, the processor
  48. first looks for a target dataset in the
  49. olink database starting with:</para>
  50. <literallayout><literal>&lt;document targetdoc="adminguide" lang="de"&gt;</literal>.
  51. </literallayout>
  52. <para>If there is no such element, then the
  53. <parameter>olink.lang.fallback.sequence</parameter>
  54. parameter is consulted.
  55. If its value is, for example, <quote>fr en</quote>, then the processor next
  56. looks for <literal>targetdoc="adminguide" lang="fr"</literal>, and
  57. then for <literal>targetdoc="adminguide" lang="en"</literal>.
  58. If there is still no match, it looks for
  59. <literal>targetdoc="adminguide"</literal> with no
  60. lang attribute.
  61. </para>
  62. <para>This parameter is useful when a set of documents is only
  63. partially translated, or is in the process of being translated.
  64. If a target of an olink has not yet been translated, then this
  65. parameter permits the processor to look for the document in
  66. other languages. This assumes the reader would rather have
  67. a link to a document in a different language than to have
  68. a broken link.
  69. </para>
  70. </refsection>
  71. </refentry>