aboutsummaryrefslogtreecommitdiff
path: root/xml/lingua.conf.in
blob: c376f99bf4afeca275be1695825dfd9ca78e2689 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
 <LOGO SRC="graphics/parthenon-gnu.png" ALT=" [A GNU in front of the Parthenon] " />
 <DIRECTORY CGIBIN="=SCRIPT_DIR=" />
 <DIRECTORY TMP="=TMPDIR=" />
 <DIRECTORY OUT="=OUTDIR=" />
 <DIRECTORY TARGET="=TARGET_DIR=" />
 <DIRECTORY SOUND="/sound" />

 <DICT PROG="dict.=SCRIPT_SUFFIX=" /> 
 <BASE HREF="=BASE_HREF=" />
 <SOUNDREF>
  <![CDATA[
   <img src="graphics/audio.png" width="16" height="16" alt="[ sound ]" />]]>
 </SOUNDREF>
 <SEARCH ARGS="(list (lingua:gettext &quot;Search&quot;))">
   <![CDATA[
    <form method="get"
          action="http://www.google.com/custom"
          enctype="application/x-www-form-urlencoded">
      ~A <img src="graphics/google.png" alt="[Google]" width="75" height="32" />
      <input type="text" size="30" maxlength="255" name="q" value="">
      <input type="hidden" name="cof" value="L:http://ellinika.gnu.org.ua/graphics/parthenon-gnu.png;LW:180;LH:140;T:black;ALC:#ff3300;LC:#000099;BGC:white;AH:left;VLC:#660066;GL:0;" />

      <input type="hidden" id="searchEllinika" name="sitesearch" checked="checked" value="ellinika.gnu.org.ua" />
      <input type="hidden" name="domains" value="ellinika.gnu.org.ua" />
    </form>]]>
 </SEARCH>
 <GUILE>
  <![CDATA[
(use-modules (xmltools xmltrans)
             (xmltools gamlet)
	     (xmltrans lingua)
             (xmltools dict)
	     (ice-9 format))

(define-macro (install-nea)
 `(use-modules (xmltrans lingua)
	       (xmltools dict))
    (letrec ((nea (lambda (. args)
	            (string-append
		     (lingua:get-cgi-bin)
		     "/nea.=SCRIPT_SUFFIX=?LANG="
		     (lingua:LANG args)))))
      (xmltrans:set-attr "LINGUA" "NEA" nea)))
      	     
(xmltrans:end-tag
 "KATHAREVUSA"
 (tag attr text)
 (list "<div class=\"katharevusa\">" text "</div>"))

(xmltrans:end-tag
 "news"
 (tag attr text)
 (list "<div id=\"news-content\"><div id=\"news\">" text "</div></div>"))

(xmltrans:end-tag
 "news:summary"
 (tag attr text)
 (list "<div id=\"news-summary\">" text "</div>"))

(xmltrans:end-tag
 "news:article"
 (tag attr text)
 (list "<div id=\"news-article\">" text "</div>"))

(xmltrans:end-tag
 "news:header"
 (tag attr text)
 (list "<div class=\"news-header\">" text "</div>"))

(xmltrans:end-tag
 "news:permanent-article"
 (tag attr text)
 (list "<div class=\"permanent-article\">" text "</div>"))

(gamlet:set-handler "INFO"
		    (lambda (. args)
		      (display "<ul class=\"menu\">")
		      (format #t "<li class=\"group\"><div class=\"group\">~A</div>"
			      (lingua:gettext "This page in other languages"))
		      (display "<ul class=\"menu\">")
		      (let* ((name (string-split
				    (gamlet:current-output-file-name) #\/))
			     (rest (substring (gamlet:current-output-file-name)
					      (1+ (string-length (car name))))))
			(for-each
			 (lambda (lang)
			   (cond
			    ((not (string=? (car lang) (car name)))
			     (if (not (null? args))
				 (format #t "<li><a href=\"~A@@args@@\">~A</a></li>"
					 ((lingua:attr "LINGUA" (car args))
					  #:lang (car lang))
					 (cdr lang))
				 (format #t "<li><a href=\"~A/~A\">~A</a></li>"
					 (car lang)
					 rest
					 (cdr lang))))))
			 '(("pl" . "Polski")
			   ("ru" . "Русский")
			   ("uk" . "Українська"))))
		      (display "</ul></li></ul>")))
#f
 ]]>
 </GUILE>
</CONFIG>

<!-- Local Variables: -->
<!-- mode: sgml -->
<!-- End: -->

Return to:

Send suggestions and report system problems to the System administrator.