1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//FI"
9 <style-specification id="docbook-l10n-fi">
10 <style-specification-body>
13 ;; This file is part of the Modular DocBook Stylesheet distribution.
14 ;; See ../README or http://nwalsh.com/docbook/dsssl/
17 ;; ----------------------------- Localization -----------------------------
19 ;; If you create a new version of this file, please send it to
20 ;; Norman Walsh, ndw@nwalsh.com
22 ;; The generated text for cross references to elements. See dblink.dsl
23 ;; for a discussion of how substitution is performed on the %x
27 (define (fi-author-string #!optional (author (current-node)))
28 ;; Return a formatted string representation of the contents of:
30 ;; Handles Honorific, FirstName, SurName, and Lineage.
31 ;; If %author-othername-in-middle% is #t, also OtherName
32 ;; Handles *only* the first of each.
33 ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage"
35 ;; returns (data corpauthor)
36 (let* ((h_nl (select-elements (descendants author) (normalize "honorific")))
37 (f_nl (select-elements (descendants author) (normalize "firstname")))
38 (o_nl (select-elements (descendants author) (normalize "othername")))
39 (s_nl (select-elements (descendants author) (normalize "surname")))
40 (l_nl (select-elements (descendants author) (normalize "lineage")))
41 (has_h (not (node-list-empty? h_nl)))
42 (has_f (not (node-list-empty? f_nl)))
43 (has_o (and %author-othername-in-middle%
44 (not (node-list-empty? o_nl))))
45 (has_s (not (node-list-empty? s_nl)))
46 (has_l (not (node-list-empty? l_nl))))
47 (if (or (equal? (gi author) (normalize "author"))
48 (equal? (gi author) (normalize "editor"))
49 (equal? (gi author) (normalize "othercredit")))
51 (if has_h (string-append (data-of (node-list-first h_nl))
52 %honorific-punctuation%) "")
53 (if has_f (string-append
55 (data-of (node-list-first f_nl))) "")
56 (if has_o (string-append
57 (if (or has_h has_f) " " "")
58 (data-of (node-list-first o_nl))) "")
59 (if has_s (string-append
60 (if (or has_h has_f has_o) " " "")
61 (data-of (node-list-first s_nl))) "")
62 (if has_l (string-append ", " (data-of (node-list-first l_nl))) ""))
65 (define (fi-xref-strings)
66 (list (list (normalize "appendix") (if %chapter-autolabel%
69 (list (normalize "article") (string-append %gentext-fi-start-quote%
71 %gentext-fi-end-quote%))
72 (list (normalize "bibliography") "%t")
73 (list (normalize "book") "%t")
74 (list (normalize "chapter") (if %chapter-autolabel%
77 (list (normalize "equation") "&Equation; %n")
78 (list (normalize "example") "&Example; %n")
79 (list (normalize "figure") "&Figure; %n")
80 (list (normalize "glossary") "%t")
81 (list (normalize "index") "%t")
82 (list (normalize "listitem") "%n")
83 (list (normalize "part") "&Part; %n")
84 (list (normalize "preface") "%t")
85 (list (normalize "procedure") "&Procedure; %n, %t")
86 (list (normalize "reference") "&Reference; %n, %t")
87 (list (normalize "section") (if %section-autolabel%
90 (list (normalize "sect1") (if %section-autolabel%
93 (list (normalize "sect2") (if %section-autolabel%
96 (list (normalize "sect3") (if %section-autolabel%
99 (list (normalize "sect4") (if %section-autolabel%
102 (list (normalize "sect5") (if %section-autolabel%
105 (list (normalize "simplesect") (if %section-autolabel%
108 (list (normalize "sidebar") "%t")
109 (list (normalize "step") "&step; %n")
110 (list (normalize "table") "&Table; %n")))
112 (define (gentext-fi-xref-strings gind)
113 (let* ((giname (if (string? gind) gind (gi gind)))
114 (name (normalize giname))
115 (xref (assoc name (fi-xref-strings))))
118 (let* ((msg (string-append "[&xrefto; "
119 (if giname giname "&nonexistantelement;")
121 (err (node-list-error msg (current-node))))
124 (define (fi-auto-xref-indirect-connector before)
125 ;; In English, the (cond) is unnecessary since the word is always the
126 ;; same, but in other languages, that's not the case. I've set this
127 ;; one up with the (cond) so it stands as an example.
129 ((equal? (gi before) (normalize "book"))
131 ((equal? (gi before) (normalize "chapter"))
133 ((equal? (gi before) (normalize "sect1"))
136 (literal " ∈ "))))
138 ;; Should the TOC come first or last?
140 (define %generate-fi-toc-in-front% #t)
142 ;; gentext-element-name returns the generated text that should be
143 ;; used to make reference to the selected element.
146 (define (fi-element-name)
148 (list (normalize "abstract") "&Abstract;")
149 (list (normalize "answer") "&Answer;")
150 (list (normalize "appendix") "&Appendix;")
151 (list (normalize "article") "&Article;")
152 (list (normalize "bibliography") "&Bibliography;")
153 (list (normalize "book") "&Book;")
154 (list (normalize "calloutlist") "")
155 (list (normalize "caution") "&Caution;")
156 (list (normalize "chapter") "&Chapter;")
157 (list (normalize "copyright") "&Copyright;")
158 (list (normalize "dedication") "&Dedication;")
159 (list (normalize "edition") "&Edition;")
160 (list (normalize "equation") "&Equation;")
161 (list (normalize "example") "&Example;")
162 (list (normalize "figure") "&Figure;")
163 (list (normalize "glossary") "&Glossary;")
164 (list (normalize "glosssee") "&GlossSee;")
165 (list (normalize "glossseealso") "&GlossSeeAlso;")
166 (list (normalize "important") "&Important;")
167 (list (normalize "index") "&Index;")
168 (list (normalize "colophon") "&Colophon;")
169 (list (normalize "setindex") "&SetIndex;")
170 (list (normalize "isbn") "&isbn;")
171 (list (normalize "legalnotice") "&LegalNotice;")
172 (list (normalize "msgaud") "&MsgAud;")
173 (list (normalize "msglevel") "&MsgLevel;")
174 (list (normalize "msgorig") "&MsgOrig;")
175 (list (normalize "note") "&Note;")
176 (list (normalize "part") "&Part;")
177 (list (normalize "preface") "&Preface;")
178 (list (normalize "procedure") "&Procedure;")
179 (list (normalize "pubdate") "&Published;")
180 (list (normalize "question") "&Question;")
181 (list (normalize "refentry") "&RefEntry;")
182 (list (normalize "reference") "&Reference;")
183 (list (normalize "refname") "&RefName;")
184 (list (normalize "revhistory") "&RevHistory;")
185 (list (normalize "refsect1") "&RefSection;")
186 (list (normalize "refsect2") "&RefSection;")
187 (list (normalize "refsect3") "&RefSection;")
188 (list (normalize "refsynopsisdiv") "&RefSynopsisDiv;")
189 (list (normalize "revision") "&Revision;")
190 (list (normalize "sect1") "&Section;")
191 (list (normalize "sect2") "&Section;")
192 (list (normalize "sect3") "&Section;")
193 (list (normalize "sect4") "&Section;")
194 (list (normalize "sect5") "&Section;")
195 (list (normalize "section") "&Section;")
196 (list (normalize "simplesect") "&Section;")
197 (list (normalize "seeie") "&See;")
198 (list (normalize "seealsoie") "&Seealso;")
199 (list (normalize "set") "&Set;")
200 (list (normalize "sidebar") "&Sidebar;")
201 (list (normalize "step") "&step;")
202 (list (normalize "table") "&Table;")
203 (list (normalize "tip") "&Tip;")
204 (list (normalize "toc") "&TableofContents;")
205 (list (normalize "warning") "&Warning;")
208 (define (gentext-fi-element-name gind)
209 (let* ((giname (if (string? gind) gind (gi gind)))
210 (name (normalize giname))
211 (pname (assoc name (fi-element-name))))
214 (let* ((msg (string-append
215 "gentext-fi-element-name: &unexpectedelementname;: "
217 (err (node-list-error msg (current-node))))
220 ;; gentext-element-name-space returns gentext-element-name with a
221 ;; trailing space, if gentext-element-name isn't "".
223 (define (gentext-fi-element-name-space giname)
224 (string-with-space (gentext-element-name giname)))
226 ;; gentext-intra-label-sep returns the seperator to be inserted
227 ;; between multiple occurances of a label (or parts of a label)
228 ;; for the specified element. Most of these are for enumerated
229 ;; labels like "Figure 2-4", but this function is used elsewhere
230 ;; (e.g. REFNAME) with a little abuse.
233 (define (local-fi-intra-label-sep)
236 (define (fi-intra-label-sep)
238 (list (normalize "equation") "-")
239 (list (normalize "informalequation") "-")
240 (list (normalize "example") "-")
241 (list (normalize "figure") "-")
242 (list (normalize "listitem") ".")
243 (list (normalize "procedure") ".")
244 (list (normalize "refentry") ".")
245 (list (normalize "reference") ".")
246 (list (normalize "refname") ", ")
247 (list (normalize "refsect1") ".")
248 (list (normalize "refsect2") ".")
249 (list (normalize "refsect3") ".")
250 (list (normalize "sect1") ".")
251 (list (normalize "sect2") ".")
252 (list (normalize "sect3") ".")
253 (list (normalize "sect4") ".")
254 (list (normalize "sect5") ".")
255 (list (normalize "section") ".")
256 (list (normalize "simplesect") ".")
257 (list (normalize "step") ".")
258 (list (normalize "table") "-")
259 (list (normalize "_pagenumber") "-")
262 (define (gentext-fi-intra-label-sep gind)
263 (let* ((giname (if (string? gind) gind (gi gind)))
264 (name (normalize giname))
265 (lsep (assoc name (local-fi-intra-label-sep)))
266 (sep (assoc name (fi-intra-label-sep))))
273 ;; gentext-label-title-sep returns the seperator to be inserted
274 ;; between a label and the text following the label for the
275 ;; specified element. Most of these are for use between
276 ;; enumerated labels and titles like "1. Chapter One Title", but
277 ;; this function is used elsewhere (e.g. NOTE) with a little
281 (define (local-fi-label-title-sep)
284 (define (fi-label-title-sep)
286 (list (normalize "abstract") ": ")
287 (list (normalize "answer") " ")
288 (list (normalize "appendix") ". ")
289 (list (normalize "caution") "")
290 (list (normalize "chapter") ". ")
291 (list (normalize "equation") ". ")
292 (list (normalize "example") ". ")
293 (list (normalize "figure") ". ")
294 (list (normalize "footnote") ". ")
295 (list (normalize "glosssee") ": ")
296 (list (normalize "glossseealso") ": ")
297 (list (normalize "important") ": ")
298 (list (normalize "note") ": ")
299 (list (normalize "orderedlist") ". ")
300 (list (normalize "part") ". ")
301 (list (normalize "procedure") ". ")
302 (list (normalize "prefix") ". ")
303 (list (normalize "question") " ")
304 (list (normalize "refentry") "")
305 (list (normalize "reference") ". ")
306 (list (normalize "refsect1") ". ")
307 (list (normalize "refsect2") ". ")
308 (list (normalize "refsect3") ". ")
309 (list (normalize "sect1") ". ")
310 (list (normalize "sect2") ". ")
311 (list (normalize "sect3") ". ")
312 (list (normalize "sect4") ". ")
313 (list (normalize "sect5") ". ")
314 (list (normalize "section") ". ")
315 (list (normalize "simplesect") ". ")
316 (list (normalize "seeie") " ")
317 (list (normalize "seealsoie") " ")
318 (list (normalize "step") ". ")
319 (list (normalize "table") ". ")
320 (list (normalize "tip") ": ")
321 (list (normalize "warning") "")
324 (define (gentext-fi-label-title-sep gind)
325 (let* ((giname (if (string? gind) gind (gi gind)))
326 (name (normalize giname))
327 (lsep (assoc name (local-fi-label-title-sep)))
328 (sep (assoc name (fi-label-title-sep))))
335 (define (fi-label-number-format-list)
337 (list (normalize "set") "1")
338 (list (normalize "book") "1")
339 (list (normalize "prefix") "1")
340 (list (normalize "part") "I")
341 (list (normalize "chapter") "1")
342 (list (normalize "appendix") "A")
343 (list (normalize "reference") "I")
344 (list (normalize "example") "1")
345 (list (normalize "figure") "1")
346 (list (normalize "table") "1")
347 (list (normalize "procedure") "1")
348 (list (normalize "step") "1")
349 (list (normalize "refsect1") "1")
350 (list (normalize "refsect2") "1")
351 (list (normalize "refsect3") "1")
352 (list (normalize "sect1") "1")
353 (list (normalize "sect2") "1")
354 (list (normalize "sect3") "1")
355 (list (normalize "sect4") "1")
356 (list (normalize "sect5") "1")
357 (list (normalize "section") "1")
360 (define (fi-label-number-format gind)
361 (let* ((giname (if (string? gind) gind (gi gind)))
362 (name (normalize giname))
363 (format (assoc name (fi-label-number-format-list))))
368 (define (fi-lot-title)
370 (list (normalize "table") "&ListofTables;")
371 (list (normalize "example") "&ListofExamples;")
372 (list (normalize "figure") "&ListofFigures;")
373 (list (normalize "equation") "&ListofEquations;")
376 (define ($lot-title-fi$ gind)
377 (let* ((giname (if (string? gind) gind (gi gind)))
378 (name (normalize giname))
379 (title (assoc name (fi-lot-title))))
382 (let* ((msg (string-append "&ListofUnknown;: " name))
383 (err (node-list-error msg (current-node))))
386 (define %gentext-fi-start-quote% (dingbat "ldquo"))
388 (define %gentext-fi-end-quote% (dingbat "rdquo"))
390 (define %gentext-fi-start-nested-quote% (dingbat "lsquo"))
392 (define %gentext-fi-end-nested-quote% (dingbat "rsquo"))
394 (define %gentext-fi-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
395 ;; Authored "by" Jane Doe
397 (define %gentext-fi-edited-by% "&Editedby;")
398 ;; "Edited by" Jane Doe
400 (define %gentext-fi-revised-by% "&Revisedby;")
401 ;; "Revised by" Jane Doe
403 (define %gentext-fi-page% "")
405 (define %gentext-fi-and% "∧")
407 (define %gentext-fi-listcomma% "&listcomma;")
409 (define %gentext-fi-lastlistcomma% "&lastlistcomma;")
411 (define %gentext-fi-bibl-pages% "&Pgs;")
413 (define %gentext-fi-endnotes% "&Notes;")
415 (define %gentext-fi-table-endnotes% "&TableNotes;:")
417 (define %gentext-fi-index-see% "&See;")
419 (define %gentext-fi-index-seealso% "&SeeAlso;")
422 (define (gentext-fi-nav-prev prev)
423 (make sequence (literal "&nav-prev;")))
425 (define (gentext-fi-nav-prev-sibling prevsib)
426 (make sequence (literal "&nav-prev-sibling;")))
428 (define (gentext-fi-nav-next-sibling nextsib)
429 (make sequence (literal "&nav-next-sibling;")))
431 (define (gentext-fi-nav-next next)
432 (make sequence (literal "&nav-next;")))
434 (define (gentext-fi-nav-up up)
435 (make sequence (literal "&nav-up;")))
437 (define (gentext-fi-nav-home home)
438 (make sequence (literal "&nav-home;")))
442 </style-specification-body>
443 </style-specification>