1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//AF"
9 <style-specification id="docbook-l10n-af">
10 <style-specification-body>
12 ;; $Id: dbl1af.dsl,v 1.1 2001/07/04 14:46:00 uid48421 Exp $
14 ;; This file is part of the Modular DocBook Stylesheet distribution.
15 ;; See ../README or http://nwalsh.com/docbook/dsssl/
18 ;; ----------------------------- Localization -----------------------------
20 ;; If you create a new version of this file, please send it to
21 ;; Norman Walsh, ndw@nwalsh.com
23 ;; Modified for Afrikaans
25 ;; The generated text for cross references to elements. See dblink.dsl
26 ;; for a discussion of how substitution is performed on the %x
30 (define (af-author-string #!optional (author (current-node)))
31 ;; Return a formatted string representation of the contents of:
33 ;; Handles Honorific, FirstName, SurName, and Lineage.
34 ;; If %author-othername-in-middle% is #t, also OtherName
35 ;; Handles *only* the first of each.
36 ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage"
38 ;; returns (data corpauthor)
39 (let* ((h_nl (select-elements (descendants author) (normalize "honorific")))
40 (f_nl (select-elements (descendants author) (normalize "firstname")))
41 (o_nl (select-elements (descendants author) (normalize "othername")))
42 (s_nl (select-elements (descendants author) (normalize "surname")))
43 (l_nl (select-elements (descendants author) (normalize "lineage")))
44 (has_h (not (node-list-empty? h_nl)))
45 (has_f (not (node-list-empty? f_nl)))
46 (has_o (and %author-othername-in-middle%
47 (not (node-list-empty? o_nl))))
48 (has_s (not (node-list-empty? s_nl)))
49 (has_l (not (node-list-empty? l_nl))))
50 (if (or (equal? (gi author) (normalize "author"))
51 (equal? (gi author) (normalize "editor"))
52 (equal? (gi author) (normalize "othercredit")))
54 (if has_h (string-append (data-of (node-list-first h_nl))
55 %honorific-punctuation%) "")
56 (if has_f (string-append
58 (data-of (node-list-first f_nl))) "")
59 (if has_o (string-append
60 (if (or has_h has_f) " " "")
61 (data-of (node-list-first o_nl))) "")
62 (if has_s (string-append
63 (if (or has_h has_f has_o) " " "")
64 (data-of (node-list-first s_nl))) "")
65 (if has_l (string-append ", " (data-of (node-list-first l_nl))) ""))
68 (define (af-xref-strings)
69 (list (list (normalize "appendix") (if %chapter-autolabel%
71 "the &appendix; called %t"))
72 (list (normalize "article") (string-append %gentext-af-start-quote%
74 %gentext-af-end-quote%))
75 (list (normalize "bibliography") "%t")
76 (list (normalize "book") "%t")
77 (list (normalize "chapter") (if %chapter-autolabel%
79 "the &chapter; called %t"))
80 (list (normalize "equation") "&Equation; %n")
81 (list (normalize "example") "&Example; %n")
82 (list (normalize "figure") "&Figure; %n")
83 (list (normalize "glossary") "%t")
84 (list (normalize "index") "%t")
85 (list (normalize "listitem") "%n")
86 (list (normalize "part") "&Part; %n")
87 (list (normalize "preface") "%t")
88 (list (normalize "procedure") "&Procedure; %n, %t")
89 (list (normalize "reference") "&Reference; %n, %t")
90 (list (normalize "section") (if %section-autolabel%
92 "the §ion; called %t"))
93 (list (normalize "sect1") (if %section-autolabel%
95 "the §ion; called %t"))
96 (list (normalize "sect2") (if %section-autolabel%
98 "the §ion; called %t"))
99 (list (normalize "sect3") (if %section-autolabel%
101 "the §ion; called %t"))
102 (list (normalize "sect4") (if %section-autolabel%
104 "the §ion; called %t"))
105 (list (normalize "sect5") (if %section-autolabel%
107 "the §ion; called %t"))
108 (list (normalize "simplesect") (if %section-autolabel%
110 "the §ion; called %t"))
111 (list (normalize "sidebar") "the &sidebar; %t")
112 (list (normalize "step") "&step; %n")
113 (list (normalize "table") "&Table; %n")))
115 (define (gentext-af-xref-strings gind)
116 (let* ((giname (if (string? gind) gind (gi gind)))
117 (name (normalize giname))
118 (xref (assoc name (af-xref-strings))))
121 (let* ((msg (string-append "[&xrefto; "
122 (if giname giname "&nonexistantelement;")
124 (err (node-list-error msg (current-node))))
127 (define (af-auto-xref-indirect-connector before)
128 ;; In English, the (cond) is unnecessary since the word is always the
129 ;; same, but in other languages, that's not the case. I've set this
130 ;; one up with the (cond) so it stands as an example.
132 ((equal? (gi before) (normalize "book"))
134 ((equal? (gi before) (normalize "chapter"))
136 ((equal? (gi before) (normalize "sect1"))
139 (literal " ∈ "))))
141 ;; Should the TOC come first or last?
143 (define %generate-af-toc-in-front% #t)
145 ;; gentext-element-name returns the generated text that should be
146 ;; used to make reference to the selected element.
149 (define (af-element-name)
151 (list (normalize "abstract") "&Abstract;")
152 (list (normalize "answer") "&Answer;")
153 (list (normalize "appendix") "&Appendix;")
154 (list (normalize "article") "&Article;")
155 (list (normalize "bibliography") "&Bibliography;")
156 (list (normalize "book") "&Book;")
157 (list (normalize "calloutlist") "")
158 (list (normalize "caution") "&Caution;")
159 (list (normalize "chapter") "&Chapter;")
160 (list (normalize "copyright") "&Copyright;")
161 (list (normalize "dedication") "&Dedication;")
162 (list (normalize "edition") "&Edition;")
163 (list (normalize "equation") "&Equation;")
164 (list (normalize "example") "&Example;")
165 (list (normalize "figure") "&Figure;")
166 (list (normalize "glossary") "&Glossary;")
167 (list (normalize "glosssee") "&GlossSee;")
168 (list (normalize "glossseealso") "&GlossSeeAlso;")
169 (list (normalize "important") "&Important;")
170 (list (normalize "index") "&Index;")
171 (list (normalize "colophon") "&Colophon;")
172 (list (normalize "setindex") "&SetIndex;")
173 (list (normalize "isbn") "&ISBN;")
174 (list (normalize "legalnotice") "&LegalNotice;")
175 (list (normalize "msgaud") "&MsgAud;")
176 (list (normalize "msglevel") "&MsgLevel;")
177 (list (normalize "msgorig") "&MsgOrig;")
178 (list (normalize "note") "&Note;")
179 (list (normalize "part") "&Part;")
180 (list (normalize "preface") "&Preface;")
181 (list (normalize "procedure") "&Procedure;")
182 (list (normalize "pubdate") "&Published;")
183 (list (normalize "question") "&Question;")
184 (list (normalize "refentry") "&RefEntry;")
185 (list (normalize "reference") "&Reference;")
186 (list (normalize "refname") "&RefName;")
187 (list (normalize "revhistory") "&RevHistory;")
188 (list (normalize "refsect1") "&RefSection;")
189 (list (normalize "refsect2") "&RefSection;")
190 (list (normalize "refsect3") "&RefSection;")
191 (list (normalize "refsynopsisdiv") "&RefSynopsisDiv;")
192 (list (normalize "revision") "&Revision;")
193 (list (normalize "sect1") "&Section;")
194 (list (normalize "sect2") "&Section;")
195 (list (normalize "sect3") "&Section;")
196 (list (normalize "sect4") "&Section;")
197 (list (normalize "sect5") "&Section;")
198 (list (normalize "section") "&Section;")
199 (list (normalize "simplesect") "&Section;")
200 (list (normalize "seeie") "&See;")
201 (list (normalize "seealsoie") "&Seealso;")
202 (list (normalize "set") "&Set;")
203 (list (normalize "sidebar") "&Sidebar;")
204 (list (normalize "step") "&step;")
205 (list (normalize "table") "&Table;")
206 (list (normalize "tip") "&Tip;")
207 (list (normalize "toc") "&TableofContents;")
208 (list (normalize "warning") "&Warning;")
211 (define (gentext-af-element-name gind)
212 (let* ((giname (if (string? gind) gind (gi gind)))
213 (name (normalize giname))
214 (pname (assoc name (af-element-name))))
217 (let* ((msg (string-append
218 "gentext-af-element-name: &unexpectedelementname;: "
220 (err (node-list-error msg (current-node))))
223 ;; gentext-element-name-space returns gentext-element-name with a
224 ;; trailing space, if gentext-element-name isn't "".
226 (define (gentext-af-element-name-space giname)
227 (string-with-space (gentext-element-name giname)))
229 ;; gentext-intra-label-sep returns the seperator to be inserted
230 ;; between multiple occurances of a label (or parts of a label)
231 ;; for the specified element. Most of these are for enumerated
232 ;; labels like "Figure 2-4", but this function is used elsewhere
233 ;; (e.g. REFNAME) with a little abuse.
236 (define (local-af-intra-label-sep)
239 (define (af-intra-label-sep)
241 (list (normalize "equation") "-")
242 (list (normalize "informalequation") "-")
243 (list (normalize "example") "-")
244 (list (normalize "figure") "-")
245 (list (normalize "listitem") ".")
246 (list (normalize "procedure") ".")
247 (list (normalize "refentry") ".")
248 (list (normalize "reference") ".")
249 (list (normalize "refname") ", ")
250 (list (normalize "refsect1") ".")
251 (list (normalize "refsect2") ".")
252 (list (normalize "refsect3") ".")
253 (list (normalize "sect1") ".")
254 (list (normalize "sect2") ".")
255 (list (normalize "sect3") ".")
256 (list (normalize "sect4") ".")
257 (list (normalize "sect5") ".")
258 (list (normalize "section") ".")
259 (list (normalize "simplesect") ".")
260 (list (normalize "step") ".")
261 (list (normalize "table") "-")
262 (list (normalize "_pagenumber") "-")
265 (define (gentext-af-intra-label-sep gind)
266 (let* ((giname (if (string? gind) gind (gi gind)))
267 (name (normalize giname))
268 (sep (assoc name (af-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-af-label-title-sep)
284 (define (af-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-af-label-title-sep gind)
325 (let* ((giname (if (string? gind) gind (gi gind)))
326 (name (normalize giname))
327 (sep (assoc name (af-label-title-sep))))
332 (define (af-label-number-format-list)
334 (list (normalize "set") "1")
335 (list (normalize "book") "1")
336 (list (normalize "prefix") "1")
337 (list (normalize "part") "I")
338 (list (normalize "chapter") "1")
339 (list (normalize "appendix") "A")
340 (list (normalize "reference") "I")
341 (list (normalize "example") "1")
342 (list (normalize "figure") "1")
343 (list (normalize "table") "1")
344 (list (normalize "procedure") "1")
345 (list (normalize "step") "1")
346 (list (normalize "refsect1") "1")
347 (list (normalize "refsect2") "1")
348 (list (normalize "refsect3") "1")
349 (list (normalize "sect1") "1")
350 (list (normalize "sect2") "1")
351 (list (normalize "sect3") "1")
352 (list (normalize "sect4") "1")
353 (list (normalize "sect5") "1")
354 (list (normalize "section") "1")
357 (define (af-label-number-format gind)
358 (let* ((giname (if (string? gind) gind (gi gind)))
359 (name (normalize giname))
360 (format (assoc name (af-label-number-format-list))))
365 (define (af-lot-title)
367 (list (normalize "table") "&ListofTables;")
368 (list (normalize "example") "&ListofExamples;")
369 (list (normalize "figure") "&ListofFigures;")
370 (list (normalize "equation") "&ListofEquations;")
373 (define ($lot-title-af$ gind)
374 (let* ((giname (if (string? gind) gind (gi gind)))
375 (name (normalize giname))
376 (title (assoc name (af-lot-title))))
379 (let* ((msg (string-append "&ListofUnknown;: " name))
380 (err (node-list-error msg (current-node))))
383 (define %gentext-af-start-quote% (dingbat "ldquo"))
385 (define %gentext-af-end-quote% (dingbat "rdquo"))
387 (define %gentext-af-start-nested-quote% (dingbat "lsquo"))
389 (define %gentext-af-end-nested-quote% (dingbat "rsquo"))
391 (define %gentext-af-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
392 ;; Authored "by" Jane Doe
394 (define %gentext-af-edited-by% "&Editedby;")
395 ;; "Edited by" Jane Doe
397 (define %gentext-af-revised-by% "&Revisedby;")
398 ;; "Revised by" Jane Doe
400 (define %gentext-af-page% "")
402 (define %gentext-af-and% "∧")
404 (define %gentext-af-listcomma% "&listcomma;")
406 (define %gentext-af-lastlistcomma% "&lastlistcomma;")
408 (define %gentext-af-bibl-pages% "&Pgs;")
410 (define %gentext-af-endnotes% "&Notes;")
412 (define %gentext-af-table-endnotes% "&TableNotes;:")
414 (define %gentext-af-index-see% "&See;")
416 (define %gentext-af-index-seealso% "&SeeAlso;")
419 (define (gentext-af-nav-prev prev)
420 (make sequence (literal "&nav-prev;")))
422 (define (gentext-af-nav-prev-sibling prevsib)
423 (make sequence (literal "&nav-prev-sibling;")))
425 (define (gentext-af-nav-next-sibling nextsib)
426 (make sequence (literal "&nav-next-sibling;")))
428 (define (gentext-af-nav-next next)
429 (make sequence (literal "&nav-next;")))
431 (define (gentext-af-nav-up up)
432 (make sequence (literal "&nav-up;")))
434 (define (gentext-af-nav-home home)
435 (make sequence (literal "&nav-home;")))
437 </style-specification-body>
438 </style-specification>