TIVI-153: Add docbook-style-dssl as dep for iputils
[profile/ivi/docbook-style-dsssl.git] / common / dbl1pl.dsl
1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2 <!ENTITY % pl.words
3   PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//PL"
4          "dbl1pl.ent">
5 %pl.words;
6 ]>
7
8 <style-sheet>
9 <style-specification id="docbook-l10n-pl">
10 <style-specification-body>
11
12 ;; $Id: dbl1pl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $
13 ;;
14 ;; This file is part of the Modular DocBook Stylesheet distribution.
15 ;; See ../README or http://nwalsh.com/docbook/dsssl/
16 ;;
17
18 ;; ----------------------------- Localization -----------------------------
19
20 ;; Polish localization.
21
22 ;; If you create a new version of this file, please send it to
23 ;; Norman Walsh, ndw@nwalsh.com
24
25 ;; Contributors:
26 ;; Rafa\263 Kleger-Rudomin, ip011@osi.gda.pl
27
28 (define (pl-author-string #!optional (author (current-node)))
29   ;; Return a formatted string representation of the contents of:
30   ;; AUTHOR:
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"
35   ;; CORPAUTHOR:
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")))
51         (string-append
52          (if has_h (string-append (data-of (node-list-first h_nl)) 
53                                   %honorific-punctuation%) "")
54          (if has_f (string-append 
55                     (if has_h " " "") 
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))) ""))
64         (data-of author))))
65
66 (define (pl-xref-strings)
67   (list (list (normalize "appendix")    (if %chapter-autolabel%
68                                             "&Appendix; %n"
69                                             "dodatek %t"))
70         (list (normalize "article")     (string-append %gentext-pl-start-quote%
71                                                        "%t"
72                                                        %gentext-pl-end-quote%))
73         (list (normalize "bibliography") "%t")
74         (list (normalize "book")        "%t")
75         (list (normalize "chapter")     (if %chapter-autolabel%
76                                             "&Chapter; %n"
77                                             "rozdzia&#179; %t"))
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%
89                                             "&Section; %n"
90                                             "sekcja %t"))
91         (list (normalize "sect1")       (if %section-autolabel%
92                                             "&Section; %n"
93                                             "sekcja %t"))
94         (list (normalize "sect2")       (if %section-autolabel%
95                                             "&Section; %n"
96                                             "sekcja %t"))
97         (list (normalize "sect3")       (if %section-autolabel%
98                                             "&Section; %n"
99                                             "sekcja %t"))
100         (list (normalize "sect4")       (if %section-autolabel%
101                                             "&Section; %n"
102                                             "sekcja %t"))
103         (list (normalize "sect5")       (if %section-autolabel%
104                                             "&Section; %n"
105                                             "sekcja %t"))
106         (list (normalize "simplesect")  (if %section-autolabel%
107                                             "&Section; %n"
108                                             "sekcja %t"))
109         (list (normalize "sidebar")     "&sidebar; %t")
110         (list (normalize "step")        "&step; %n")
111         (list (normalize "table")       "&Table; %n")))
112
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))))
117     (if xref
118         (car (cdr xref))
119         (let* ((msg    (string-append "[&xrefto; "
120                                       (if giname giname "&nonexistantelement;")
121                                       " &unsupported;]"))
122                (err    (node-list-error msg (current-node))))
123           msg))))
124
125 (define (pl-auto-xref-indirect-connector before) 
126   (literal " &in; "))
127
128 ;; Should the TOC come first or last?
129 ;;
130 (define %generate-pl-toc-in-front% #t)
131
132 ;; gentext-element-name returns the generated text that should be 
133 ;; used to make reference to the selected element.
134 ;;
135
136 (define (pl-element-name)
137   (list
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;")
196    ))
197
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))))
202     (if pname
203         (car (cdr pname))
204         (let* ((msg (string-append 
205                      "gentext-pl-element-name: &unexpectedelementname;: "
206                      name))
207                (err (node-list-error msg (current-node))))
208           msg))))
209
210 ;; gentext-element-name-space returns gentext-element-name with a 
211 ;; trailing space, if gentext-element-name isn't "".
212 ;;
213 (define (gentext-pl-element-name-space giname)
214   (string-with-space (gentext-element-name giname)))
215
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.
221 ;;
222
223 (define (local-pl-intra-label-sep)
224   (list))
225
226 (define (pl-intra-label-sep)
227   (list
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")      "-")
250    ))
251
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))))
257     (if lsep
258         (car (cdr lsep))
259         (if sep
260             (car (cdr sep))
261             ""))))
262
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
268 ;; abuse.
269 ;;
270
271 (define (local-pl-label-title-sep)
272   (list))
273
274 (define (pl-label-title-sep)
275   (list
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")          "")
312    ))
313
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))))
319     (if lsep
320       (car (cdr lsep))
321       (if sep
322           (car (cdr sep))
323           ""))))
324
325 (define (pl-label-number-format-list)
326   (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")
348    ))
349
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))))
354     (if format
355         (car (cdr format))
356         "1")))
357
358 (define (pl-lot-title)
359   (list
360    (list (normalize "table")            "&ListofTables;")
361    (list (normalize "example")          "&ListofExamples;")
362    (list (normalize "figure")           "&ListofFigures;")
363    (list (normalize "equation")         "&ListofEquations;")
364    ))
365
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))))
370     (if title
371         (car (cdr title))
372         (let* ((msg (string-append "&ListofUnknown;: " name))
373                (err (node-list-error msg (current-node))))
374           msg))))
375
376 (define %gentext-pl-start-quote%  (dingbat "ldquor"))
377
378 (define %gentext-pl-end-quote%  (dingbat "rdquor"))
379
380 (define %gentext-pl-start-nested-quote%  (dingbat "lsquo"))
381
382 (define %gentext-pl-end-nested-quote%  (dingbat "rsquo"))
383
384 (define %gentext-pl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
385                            ;; Authored "by" Jane Doe
386
387 (define %gentext-pl-edited-by% "&Editedby;")
388                            ;; "Edited by" Jane Doe
389
390 (define %gentext-pl-revised-by% "&Revisedby;")
391                            ;; "Revised by" Jane Doe
392
393 (define %gentext-pl-page% "")
394
395 (define %gentext-pl-and% "&and;")
396
397 (define %gentext-pl-listcomma% "&listcomma;")
398
399 (define %gentext-pl-lastlistcomma% "&lastlistcomma;")
400
401 (define %gentext-pl-bibl-pages% "&Pgs;")
402
403 (define %gentext-pl-endnotes% "&Notes;")
404
405 (define %gentext-pl-table-endnotes% "&TableNotes;:")
406
407 (define %gentext-pl-index-see% "&See;")
408
409 (define %gentext-pl-index-seealso% "&SeeAlso;")
410
411
412 (define (gentext-pl-nav-prev prev) 
413   (make sequence (literal "&nav-prev;")))
414
415 (define (gentext-pl-nav-prev-sibling prevsib) 
416   (make sequence (literal "&nav-prev-sibling;")))
417
418 (define (gentext-pl-nav-next-sibling nextsib)
419   (make sequence (literal "&nav-next-sibling;")))
420
421 (define (gentext-pl-nav-next next)
422   (make sequence (literal "&nav-next;")))
423
424 (define (gentext-pl-nav-up up)
425   (make sequence (literal "&nav-up;")))
426
427 (define (gentext-pl-nav-home home)
428   (make sequence (literal "&nav-home;")))
429
430
431
432 </style-specification-body>
433 </style-specification>
434 </style-sheet>