aboutsummaryrefslogtreecommitdiff
path: root/xml/lingua.conf.in
blob: d736bcbbafc9bfe7fe06f48f083b598886e88483 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?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="=TARGET_DIR=/sound" />

 <AUTHOR EMAIL="=PACKAGE_BUGREPORT=" HOMEPAGE="http://gray.gnu.org.ua" />

 <DICT PROG="dict.=SCRIPT_SUFFIX=" /> 
 <BASE HREF="=BASE_HREF=" />
 <SEARCH ARGS="(list (lingua:gettext &quot;Search&quot;) (lingua:attr &quot;LINGUA&quot; &quot;LANG&quot;))">
   <![CDATA[
    <form method="get"
	  action="/search"
          enctype="application/x-www-form-urlencoded">
     <div>
      <label for="searchinput">	  
       ~A <input id="searchinput" type="text" size="30" maxlength="255" name="q" value="" />
      </label>
      <input type="hidden" id="searchlang" name="l" value="~A" />
     </div> 
    </form>
    ]]>
 </SEARCH>
 <GUILE>
  <![CDATA[
(use-modules (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)))

(define-macro (install-conj)
 `(use-modules (xmltrans lingua)
	       (xmltools dict))
    (letrec ((conj (lambda (. args)
	            (string-append
		     (lingua:get-cgi-bin)
		     "/conj.=SCRIPT_SUFFIX=?lang="
		     (lingua:LANG args)))))
      (xmltrans:set-attr "LINGUA" "CONJ" conj)))

(define-macro (install-srch)
 `(letrec ((srch (lambda (. args)
                  (string-append "/search?l=" (lingua:LANG args)))))
    (xmltrans:set-attr "LINGUA" "SRCH" srch)))

(xmltrans:end-tag
 "FOOTER"
 (tag attr text)
 (list
   "<p>\n"
   (let ((contact (or
                   (lingua:attr "AUTHOR" "CONTACT")
                   (lingua:tag-text "AUTHOR") )))
     (format #f "~A <a href=\"mailto:~A\">~A</a>;"
	  (lingua:gettext "For information about this site contact")
	  (lingua:attr "AUTHOR" "EMAIL")
	  contact))
   "</p>\n<p>"
   text
   "</p>\n"
   "<p>Verbatim copying and distribution of this entire article are
permitted worldwide, without royalty, in any medium, provided
this notice is preserved.</p>\n"

   "<div class=\"hidden-info\">Page generated on "
   (strftime "%c" (localtime (current-time)))
   (let ((vcs-id (or (xmltrans:attr attr "VCS-ID")
                     (lingua:getval "VCSID"))))
      (cond
       ((not vcs-id) "")
       ((string-null? vcs-id) "")
       ((let ((v (lingua:getval "STATE"))) (and v (string=? v "EXP")))
        (string-append " from <a href=\"http://git.gnu.org.ua/cgit/ellinika.git/commit/?id=" vcs-id "\">" vcs-id "</a>"))
       (else
        (string-append " from " vcs-id))))
   "</div>"
	
))

(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 "THIS-REF"
		    (lambda (. args)
                      (display "http://ellinika.gnu.org.ua/")
                      (display (gamlet:current-output-file-name))))

(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>")))

(xmltrans:end-tag
 "IMAGE"
 (tag attr text)
 (let ((alt (or (xmltrans:attr attr "ALT") ""))
       (src (xmltrans:attr attr "SRC")))
   (list "<img class=\"ellinika-img\" ALT=\"[ " alt
    " ]\" src=\"/graphics/" src "\" />")))

#f
 ]]>
 </GUILE>
</CONFIG>

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

Return to:

Send suggestions and report system problems to the System administrator.