1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//TR"
9 <style-specification id="docbook-l10n-tr">
10 <style-specification-body>
12 ;; $Id: dbl1tr.dsl,v 1.2 2002/06/06 13:19:30 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 ;; If you create a new version of this file, please send it to
21 ;; Norman Walsh, ndw@nwalsh.com
23 ;; Modified for Turkish by Baurjan Ismagulov, ibr@gantek.com
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 (tr-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 (tr-xref-strings)
69 (list (list (normalize "appendix") (if %chapter-autolabel%
71 "the &appendix; called %t"))
72 (list (normalize "article") (string-append %gentext-tr-start-quote%
74 %gentext-tr-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-tr-xref-strings gind)
116 (let* ((giname (if (string? gind) gind (gi gind)))
117 (name (normalize giname))
118 (xref (assoc name (tr-xref-strings))))
121 (let* ((msg (string-append "[&xrefto; "
122 (if giname giname "&nonexistantelement;")
124 (err (node-list-error msg (current-node))))
127 (define (tr-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-tr-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 (tr-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-tr-element-name gind)
212 (let* ((giname (if (string? gind) gind (gi gind)))
213 (name (normalize giname))
214 (pname (assoc name (tr-element-name))))
217 (let* ((msg (string-append
218 "gentext-tr-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-tr-element-name-space giname)
227 (string-with-space (gentext-element-name giname)))
229 ;; gentext-intra-label-sep returns the separator to be inserted
230 ;; between multiple occurrences 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-tr-intra-label-sep)
239 (define (tr-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-tr-intra-label-sep gind)
266 (let* ((giname (if (string? gind) gind (gi gind)))
267 (name (normalize giname))
268 (lsep (assoc name (local-tr-intra-label-sep)))
269 (sep (assoc name (tr-intra-label-sep))))
276 ;; gentext-label-title-sep returns the separator to be inserted
277 ;; between a label and the text following the label for the
278 ;; specified element. Most of these are for use between
279 ;; enumerated labels and titles like "1. Chapter One Title", but
280 ;; this function is used elsewhere (e.g. NOTE) with a little
284 (define (local-tr-label-title-sep)
287 (define (tr-label-title-sep)
289 (list (normalize "abstract") ": ")
290 (list (normalize "answer") " ")
291 (list (normalize "appendix") ". ")
292 (list (normalize "caution") "")
293 (list (normalize "chapter") ". ")
294 (list (normalize "equation") ". ")
295 (list (normalize "example") ". ")
296 (list (normalize "figure") ". ")
297 (list (normalize "footnote") ". ")
298 (list (normalize "glosssee") ": ")
299 (list (normalize "glossseealso") ": ")
300 (list (normalize "important") ": ")
301 (list (normalize "note") ": ")
302 (list (normalize "orderedlist") ". ")
303 (list (normalize "part") ". ")
304 (list (normalize "procedure") ". ")
305 (list (normalize "prefix") ". ")
306 (list (normalize "question") " ")
307 (list (normalize "refentry") "")
308 (list (normalize "reference") ". ")
309 (list (normalize "refsect1") ". ")
310 (list (normalize "refsect2") ". ")
311 (list (normalize "refsect3") ". ")
312 (list (normalize "sect1") ". ")
313 (list (normalize "sect2") ". ")
314 (list (normalize "sect3") ". ")
315 (list (normalize "sect4") ". ")
316 (list (normalize "sect5") ". ")
317 (list (normalize "section") ". ")
318 (list (normalize "simplesect") ". ")
319 (list (normalize "seeie") " ")
320 (list (normalize "seealsoie") " ")
321 (list (normalize "step") ". ")
322 (list (normalize "table") ". ")
323 (list (normalize "tip") ": ")
324 (list (normalize "warning") "")
327 (define (gentext-tr-label-title-sep gind)
328 (let* ((giname (if (string? gind) gind (gi gind)))
329 (name (normalize giname))
330 (sep (assoc name (tr-label-title-sep))))
335 (define (tr-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 (tr-label-number-format gind)
361 (let* ((giname (if (string? gind) gind (gi gind)))
362 (name (normalize giname))
363 (format (assoc name (tr-label-number-format-list))))
368 (define (tr-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-tr$ gind)
377 (let* ((giname (if (string? gind) gind (gi gind)))
378 (name (normalize giname))
379 (title (assoc name (tr-lot-title))))
382 (let* ((msg (string-append "&ListofUnknown;: " name))
383 (err (node-list-error msg (current-node))))
386 (define %gentext-tr-start-quote% (dingbat "ldquo"))
388 (define %gentext-tr-end-quote% (dingbat "rdquo"))
390 (define %gentext-tr-start-nested-quote% (dingbat "lsquo"))
392 (define %gentext-tr-end-nested-quote% (dingbat "rsquo"))
394 (define %gentext-tr-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
395 ;; Authored "by" Jane Doe
397 (define %gentext-tr-edited-by% "&Editedby;")
398 ;; "Edited by" Jane Doe
400 (define %gentext-tr-revised-by% "&Revisedby;")
401 ;; "Revised by" Jane Doe
403 (define %gentext-tr-page% "")
405 (define %gentext-tr-and% "∧")
407 (define %gentext-tr-listcomma% "&listcomma;")
409 (define %gentext-tr-lastlistcomma% "&lastlistcomma;")
411 (define %gentext-tr-bibl-pages% "&Pgs;")
413 (define %gentext-tr-endnotes% "&Notes;")
415 (define %gentext-tr-table-endnotes% "&TableNotes;:")
417 (define %gentext-tr-index-see% "&See;")
419 (define %gentext-tr-index-seealso% "&SeeAlso;")
422 (define (gentext-tr-nav-prev prev)
423 (make sequence (literal "&nav-prev;")))
425 (define (gentext-tr-nav-prev-sibling prevsib)
426 (make sequence (literal "&nav-prev-sibling;")))
428 (define (gentext-tr-nav-next-sibling nextsib)
429 (make sequence (literal "&nav-next-sibling;")))
431 (define (gentext-tr-nav-next next)
432 (make sequence (literal "&nav-next;")))
434 (define (gentext-tr-nav-up up)
435 (make sequence (literal "&nav-up;")))
437 (define (gentext-tr-nav-home home)
438 (make sequence (literal "&nav-home;")))
441 </style-specification-body>
442 </style-specification>