1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//PL"
9 <style-specification id="docbook-l10n-pl">
10 <style-specification-body>
12 ;; $Id: dbl1pl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $
14 ;; This file is part of the Modular DocBook Stylesheet distribution.
15 ;; See ../README or http://nwalsh.com/docbook/dsssl/
18 ;; ----------------------------- Localization -----------------------------
20 ;; Polish localization.
22 ;; If you create a new version of this file, please send it to
23 ;; Norman Walsh, ndw@nwalsh.com
26 ;; Rafa\263 Kleger-Rudomin, ip011@osi.gda.pl
28 (define (pl-author-string #!optional (author (current-node)))
29 ;; Return a formatted string representation of the contents of:
31 ;; Handles Honorific, FirstName, SurName, and Lineage.
32 ;; If %author-othername-in-middle% is #t, also OtherName
33 ;; Handles *only* the first of each.
34 ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage"
36 ;; returns (data corpauthor)
37 (let* ((h_nl (select-elements (descendants author) (normalize "honorific")))
38 (f_nl (select-elements (descendants author) (normalize "firstname")))
39 (o_nl (select-elements (descendants author) (normalize "othername")))
40 (s_nl (select-elements (descendants author) (normalize "surname")))
41 (l_nl (select-elements (descendants author) (normalize "lineage")))
42 (has_h (not (node-list-empty? h_nl)))
43 (has_f (not (node-list-empty? f_nl)))
44 (has_o (and %author-othername-in-middle%
45 (not (node-list-empty? o_nl))))
46 (has_s (not (node-list-empty? s_nl)))
47 (has_l (not (node-list-empty? l_nl))))
48 (if (or (equal? (gi author) (normalize "author"))
49 (equal? (gi author) (normalize "editor"))
50 (equal? (gi author) (normalize "othercredit")))
52 (if has_h (string-append (data-of (node-list-first h_nl))
53 %honorific-punctuation%) "")
54 (if has_f (string-append
56 (data-of (node-list-first f_nl))) "")
57 (if has_o (string-append
58 (if (or has_h has_f) " " "")
59 (data-of (node-list-first o_nl))) "")
60 (if has_s (string-append
61 (if (or has_h has_f has_o) " " "")
62 (data-of (node-list-first s_nl))) "")
63 (if has_l (string-append ", " (data-of (node-list-first l_nl))) ""))
66 (define (pl-xref-strings)
67 (list (list (normalize "appendix") (if %chapter-autolabel%
70 (list (normalize "article") (string-append %gentext-pl-start-quote%
72 %gentext-pl-end-quote%))
73 (list (normalize "bibliography") "%t")
74 (list (normalize "book") "%t")
75 (list (normalize "chapter") (if %chapter-autolabel%
78 (list (normalize "equation") "&Equation; %n")
79 (list (normalize "example") "&Example; %n")
80 (list (normalize "figure") "&Figure; %n")
81 (list (normalize "glossary") "%t")
82 (list (normalize "index") "%t")
83 (list (normalize "listitem") "%n")
84 (list (normalize "part") "&Part; %n")
85 (list (normalize "preface") "%t")
86 (list (normalize "procedure") "&Procedure; %n, %t")
87 (list (normalize "reference") "&Reference; %n, %t")
88 (list (normalize "section") (if %section-autolabel%
91 (list (normalize "sect1") (if %section-autolabel%
94 (list (normalize "sect2") (if %section-autolabel%
97 (list (normalize "sect3") (if %section-autolabel%
100 (list (normalize "sect4") (if %section-autolabel%
103 (list (normalize "sect5") (if %section-autolabel%
106 (list (normalize "simplesect") (if %section-autolabel%
109 (list (normalize "sidebar") "&sidebar; %t")
110 (list (normalize "step") "&step; %n")
111 (list (normalize "table") "&Table; %n")))
113 (define (gentext-pl-xref-strings gind)
114 (let* ((giname (if (string? gind) gind (gi gind)))
115 (name (normalize giname))
116 (xref (assoc name (pl-xref-strings))))
119 (let* ((msg (string-append "[&xrefto; "
120 (if giname giname "&nonexistantelement;")
122 (err (node-list-error msg (current-node))))
125 (define (pl-auto-xref-indirect-connector before)
128 ;; Should the TOC come first or last?
130 (define %generate-pl-toc-in-front% #t)
132 ;; gentext-element-name returns the generated text that should be
133 ;; used to make reference to the selected element.
136 (define (pl-element-name)
138 (list (normalize "abstract") "&Abstract;")
139 (list (normalize "answer") "&Answer;")
140 (list (normalize "appendix") "&Appendix;")
141 (list (normalize "article") "&Article;")
142 (list (normalize "bibliography") "&Bibliography;")
143 (list (normalize "book") "&Book;")
144 (list (normalize "calloutlist") "")
145 (list (normalize "caution") "&Caution;")
146 (list (normalize "chapter") "&Chapter;")
147 (list (normalize "copyright") "&Copyright;")
148 (list (normalize "dedication") "&Dedication;")
149 (list (normalize "edition") "&Edition;")
150 (list (normalize "equation") "&Equation;")
151 (list (normalize "example") "&Example;")
152 (list (normalize "figure") "&Figure;")
153 (list (normalize "glossary") "&Glossary;")
154 (list (normalize "glosssee") "&GlossSee;")
155 (list (normalize "glossseealso") "&GlossSeeAlso;")
156 (list (normalize "important") "&Important;")
157 (list (normalize "index") "&Index;")
158 (list (normalize "colophon") "&Colophon;")
159 (list (normalize "setindex") "&SetIndex;")
160 (list (normalize "isbn") "&isbn;")
161 (list (normalize "legalnotice") "&LegalNotice;")
162 (list (normalize "msgaud") "&MsgAud;")
163 (list (normalize "msglevel") "&MsgLevel;")
164 (list (normalize "msgorig") "&MsgOrig;")
165 (list (normalize "note") "&Note;")
166 (list (normalize "part") "&Part;")
167 (list (normalize "preface") "&Preface;")
168 (list (normalize "procedure") "&Procedure;")
169 (list (normalize "pubdate") "&Published;")
170 (list (normalize "question") "&Question;")
171 (list (normalize "refentry") "&RefEntry;")
172 (list (normalize "reference") "&Reference;")
173 (list (normalize "refname") "&RefName;")
174 (list (normalize "revhistory") "&RevHistory;")
175 (list (normalize "refsect1") "&RefSection;")
176 (list (normalize "refsect2") "&RefSection;")
177 (list (normalize "refsect3") "&RefSection;")
178 (list (normalize "refsynopsisdiv") "&RefSynopsisDiv;")
179 (list (normalize "revision") "&Revision;")
180 (list (normalize "sect1") "&Section;")
181 (list (normalize "sect2") "&Section;")
182 (list (normalize "sect3") "&Section;")
183 (list (normalize "sect4") "&Section;")
184 (list (normalize "sect5") "&Section;")
185 (list (normalize "section") "&Section;")
186 (list (normalize "simplesect") "&Section;")
187 (list (normalize "seeie") "&See;")
188 (list (normalize "seealsoie") "&Seealso;")
189 (list (normalize "set") "&Set;")
190 (list (normalize "sidebar") "&Sidebar;")
191 (list (normalize "step") "&step;")
192 (list (normalize "table") "&Table;")
193 (list (normalize "tip") "&Tip;")
194 (list (normalize "toc") "&TableofContents;")
195 (list (normalize "warning") "&Warning;")
198 (define (gentext-pl-element-name gind)
199 (let* ((giname (if (string? gind) gind (gi gind)))
200 (name (normalize giname))
201 (pname (assoc name (pl-element-name))))
204 (let* ((msg (string-append
205 "gentext-pl-element-name: &unexpectedelementname;: "
207 (err (node-list-error msg (current-node))))
210 ;; gentext-element-name-space returns gentext-element-name with a
211 ;; trailing space, if gentext-element-name isn't "".
213 (define (gentext-pl-element-name-space giname)
214 (string-with-space (gentext-element-name giname)))
216 ;; gentext-intra-label-sep returns the seperator to be inserted
217 ;; between multiple occurances of a label (or parts of a label)
218 ;; for the specified element. Most of these are for enumerated
219 ;; labels like "Figure 2-4", but this function is used elsewhere
220 ;; (e.g. REFNAME) with a little abuse.
223 (define (local-pl-intra-label-sep)
226 (define (pl-intra-label-sep)
228 (list (normalize "equation") "-")
229 (list (normalize "informalequation") "-")
230 (list (normalize "example") "-")
231 (list (normalize "figure") "-")
232 (list (normalize "listitem") ".")
233 (list (normalize "procedure") ".")
234 (list (normalize "refentry") ".")
235 (list (normalize "reference") ".")
236 (list (normalize "refname") ", ")
237 (list (normalize "refsect1") ".")
238 (list (normalize "refsect2") ".")
239 (list (normalize "refsect3") ".")
240 (list (normalize "sect1") ".")
241 (list (normalize "sect2") ".")
242 (list (normalize "sect3") ".")
243 (list (normalize "sect4") ".")
244 (list (normalize "sect5") ".")
245 (list (normalize "section") ".")
246 (list (normalize "simplesect") ".")
247 (list (normalize "step") ".")
248 (list (normalize "table") "-")
249 (list (normalize "_pagenumber") "-")
252 (define (gentext-pl-intra-label-sep gind)
253 (let* ((giname (if (string? gind) gind (gi gind)))
254 (name (normalize giname))
255 (lsep (assoc name (local-pl-intra-label-sep)))
256 (sep (assoc name (pl-intra-label-sep))))
263 ;; gentext-label-title-sep returns the seperator to be inserted
264 ;; between a label and the text following the label for the
265 ;; specified element. Most of these are for use between
266 ;; enumerated labels and titles like "1. Chapter One Title", but
267 ;; this function is used elsewhere (e.g. NOTE) with a little
271 (define (local-pl-label-title-sep)
274 (define (pl-label-title-sep)
276 (list (normalize "abstract") ": ")
277 (list (normalize "answer") " ")
278 (list (normalize "appendix") ". ")
279 (list (normalize "caution") "")
280 (list (normalize "chapter") ". ")
281 (list (normalize "equation") ". ")
282 (list (normalize "example") ". ")
283 (list (normalize "figure") ". ")
284 (list (normalize "footnote") ". ")
285 (list (normalize "glosssee") ": ")
286 (list (normalize "glossseealso") ": ")
287 (list (normalize "important") ": ")
288 (list (normalize "note") ": ")
289 (list (normalize "orderedlist") ". ")
290 (list (normalize "part") ". ")
291 (list (normalize "procedure") ". ")
292 (list (normalize "prefix") ". ")
293 (list (normalize "question") " ")
294 (list (normalize "refentry") "")
295 (list (normalize "reference") ". ")
296 (list (normalize "refsect1") ". ")
297 (list (normalize "refsect2") ". ")
298 (list (normalize "refsect3") ". ")
299 (list (normalize "sect1") ". ")
300 (list (normalize "sect2") ". ")
301 (list (normalize "sect3") ". ")
302 (list (normalize "sect4") ". ")
303 (list (normalize "sect5") ". ")
304 (list (normalize "section") ". ")
305 (list (normalize "simplesect") ". ")
306 (list (normalize "seeie") " ")
307 (list (normalize "seealsoie") " ")
308 (list (normalize "step") ". ")
309 (list (normalize "table") ". ")
310 (list (normalize "tip") ": ")
311 (list (normalize "warning") "")
314 (define (gentext-pl-label-title-sep gind)
315 (let* ((giname (if (string? gind) gind (gi gind)))
316 (name (normalize giname))
317 (lsep (assoc name (local-pl-label-title-sep)))
318 (sep (assoc name (pl-label-title-sep))))
325 (define (pl-label-number-format-list)
327 (list (normalize "set") "1")
328 (list (normalize "book") "1")
329 (list (normalize "prefix") "1")
330 (list (normalize "part") "I")
331 (list (normalize "chapter") "1")
332 (list (normalize "appendix") "A")
333 (list (normalize "reference") "I")
334 (list (normalize "example") "1")
335 (list (normalize "figure") "1")
336 (list (normalize "table") "1")
337 (list (normalize "procedure") "1")
338 (list (normalize "step") "1")
339 (list (normalize "refsect1") "1")
340 (list (normalize "refsect2") "1")
341 (list (normalize "refsect3") "1")
342 (list (normalize "sect1") "1")
343 (list (normalize "sect2") "1")
344 (list (normalize "sect3") "1")
345 (list (normalize "sect4") "1")
346 (list (normalize "sect5") "1")
347 (list (normalize "section") "1")
350 (define (pl-label-number-format gind)
351 (let* ((giname (if (string? gind) gind (gi gind)))
352 (name (normalize giname))
353 (format (assoc name (pl-label-number-format-list))))
358 (define (pl-lot-title)
360 (list (normalize "table") "&ListofTables;")
361 (list (normalize "example") "&ListofExamples;")
362 (list (normalize "figure") "&ListofFigures;")
363 (list (normalize "equation") "&ListofEquations;")
366 (define ($lot-title-pl$ gind)
367 (let* ((giname (if (string? gind) gind (gi gind)))
368 (name (normalize giname))
369 (title (assoc name (pl-lot-title))))
372 (let* ((msg (string-append "&ListofUnknown;: " name))
373 (err (node-list-error msg (current-node))))
376 (define %gentext-pl-start-quote% (dingbat "ldquor"))
378 (define %gentext-pl-end-quote% (dingbat "rdquor"))
380 (define %gentext-pl-start-nested-quote% (dingbat "lsquo"))
382 (define %gentext-pl-end-nested-quote% (dingbat "rsquo"))
384 (define %gentext-pl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
385 ;; Authored "by" Jane Doe
387 (define %gentext-pl-edited-by% "&Editedby;")
388 ;; "Edited by" Jane Doe
390 (define %gentext-pl-revised-by% "&Revisedby;")
391 ;; "Revised by" Jane Doe
393 (define %gentext-pl-page% "")
395 (define %gentext-pl-and% "∧")
397 (define %gentext-pl-listcomma% "&listcomma;")
399 (define %gentext-pl-lastlistcomma% "&lastlistcomma;")
401 (define %gentext-pl-bibl-pages% "&Pgs;")
403 (define %gentext-pl-endnotes% "&Notes;")
405 (define %gentext-pl-table-endnotes% "&TableNotes;:")
407 (define %gentext-pl-index-see% "&See;")
409 (define %gentext-pl-index-seealso% "&SeeAlso;")
412 (define (gentext-pl-nav-prev prev)
413 (make sequence (literal "&nav-prev;")))
415 (define (gentext-pl-nav-prev-sibling prevsib)
416 (make sequence (literal "&nav-prev-sibling;")))
418 (define (gentext-pl-nav-next-sibling nextsib)
419 (make sequence (literal "&nav-next-sibling;")))
421 (define (gentext-pl-nav-next next)
422 (make sequence (literal "&nav-next;")))
424 (define (gentext-pl-nav-up up)
425 (make sequence (literal "&nav-up;")))
427 (define (gentext-pl-nav-home home)
428 (make sequence (literal "&nav-home;")))
432 </style-specification-body>
433 </style-specification>