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