aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-04-15 06:56:04 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-04-15 06:56:04 +0000
commita72a6a1666ca29de3e9d0fb01a64ada20905674f (patch)
treedce073bcf72de45952c467f402c16a3273a2ccfd
parent9a08d61db5b88828bf0ebddf153a7ec202e70a0c (diff)
downloadellinika-a72a6a1666ca29de3e9d0fb01a64ada20905674f.tar.gz
ellinika-a72a6a1666ca29de3e9d0fb01a64ada20905674f.tar.bz2
Update
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@447 941c8c0f-9102-463b-b60b-cd22ce0e6858
-rw-r--r--ellinika/i18n.scm79
-rw-r--r--xml/lingua.conf.in2
2 files changed, 43 insertions, 38 deletions
diff --git a/ellinika/i18n.scm b/ellinika/i18n.scm
index e8a0065..8d9617a 100644
--- a/ellinika/i18n.scm
+++ b/ellinika/i18n.scm
@@ -256,43 +256,48 @@
#f)))
(define (locale-setup lang domain-name locale-path)
- (cond
- ((not lang)
- (setenv "LC_ALL" "C")
- (setlocale LC_ALL "C")
- #f)
- (else
- (let ((curlocale (if (> (string-length lang) 2)
- (string-downcase (substring lang 0 2))
- lang))
- (terr #f)
- (sublocale #f)
- (domaindir #f))
-
- (cond
- ((and (> (string-length lang) 2) (char=? (string-ref lang 2) #\-))
- (set! terr (string-upcase (substring lang 3 2)))
- (set! sublocale (string-append curlocale "_" terr)))
- ((assoc-ref defterr (string->symbol curlocale)) =>
- (lambda (elt)
- (set! sublocale curlocale)
- (set! terr elt)))
- (else
- (set! sublocale curlocale)
- (set! terr "XX"))) ; Hack for languages without defined territory.
-
- (let ((domaindir (supported-locale-dir sublocale domain-name locale-path)))
- (cond
- (domaindir
- (let ((locale (string-append curlocale "_" terr ".UTF-8")))
- (setenv "LC_ALL" locale)
- (setlocale LC_ALL locale)
- (textdomain domain-name)
- (bindtextdomain domain-name domaindir)
- locale))
- ((setenv "LC_ALL" "C")
- (setlocale LC_ALL "C")
- #f)))))))
+ (catch 'system-error
+ (lambda ()
+ (cond
+ ((not lang)
+ (setenv "LC_ALL" "C")
+ (setlocale LC_ALL "C")
+ #f)
+ (else
+ (let ((curlocale (if (> (string-length lang) 2)
+ (string-downcase (substring lang 0 2))
+ lang))
+ (terr #f)
+ (sublocale #f)
+ (domaindir #f))
+
+ (cond
+ ((and (> (string-length lang) 2) (char=? (string-ref lang 2) #\-))
+ (set! terr (string-upcase (substring lang 3 2)))
+ (set! sublocale (string-append curlocale "_" terr)))
+ ((assoc-ref defterr (string->symbol curlocale)) =>
+ (lambda (elt)
+ (set! sublocale curlocale)
+ (set! terr elt)))
+ (else
+ (set! sublocale curlocale)
+ (set! terr "XX"))) ; Hack for languages without defined territory.
+
+ (let ((domaindir
+ (supported-locale-dir sublocale domain-name locale-path)))
+ (cond
+ (domaindir
+ (let ((locale (string-append curlocale "_" terr ".UTF-8")))
+ (setenv "LC_ALL" locale)
+ (setlocale LC_ALL locale)
+ (textdomain domain-name)
+ (bindtextdomain domain-name domaindir)
+ locale))
+ ((setenv "LC_ALL" "C")
+ (setlocale LC_ALL "C")
+ #f)))))))
+ (lambda args
+ #f)))
diff --git a/xml/lingua.conf.in b/xml/lingua.conf.in
index 9b8af6e..b6b7073 100644
--- a/xml/lingua.conf.in
+++ b/xml/lingua.conf.in
@@ -69,7 +69,7 @@
'(("pl" . "Polski")
("ru" . "Русский")
("uk" . "Українська"))))
- (display "</li></ul></ul>")))
+ (display "</ul></li></ul>")))
#f
]]>
</GUILE>

Return to:

Send suggestions and report system problems to the System administrator.