diff options
-rw-r--r-- | xml/lingua.conf.in | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/xml/lingua.conf.in b/xml/lingua.conf.in index 2cba2e0..a953c4f 100644 --- a/xml/lingua.conf.in +++ b/xml/lingua.conf.in @@ -8,7 +8,10 @@ <BASE HREF="=BASE_HREF=" /> <GUILE> <![CDATA[ -(use-modules (xmltools xmltrans)) +(use-modules (xmltools xmltrans) + (xmltools gamlet) + (xmltrans lingua) + (xmltools dict)) (xmltrans:end-tag "KATHAREVUSA" @@ -40,7 +43,35 @@ (tag attr text) (list "<div class=\"permanent-article\">" text "</div>")) -#f +(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=? (list-ref lang 0) (car name))) + (if (not (null? args)) + (format #t "<li><a href=\"~A@@args@@\">~A</a></li>" + ((lingua:attr "LINGUA" (car args)) + #:lang (list-ref lang 0) + #:ter (list-ref lang 1)) + (list-ref lang 2)) + (format #t "<li><a href=\"~A/~A\">~A</a></li>" + (list-ref lang 0) + rest + (list-ref lang 2)))))) + '(("pl" "PL" "Polski") + ("ru" "RU" "Русский") + ("uk" "UA" "Українська")))) + (display "</li></ul></ul>"))) +#f ]]> </GUILE> </CONFIG> |