diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-03-23 09:10:31 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-03-23 09:10:31 +0000 |
commit | 7518cda05846fe76e026caaea82417ff4c19d40d (patch) | |
tree | 0bc9c33bba1cd65e2ae19cb543b8026e49cc3b2a /ellinika | |
parent | ef11b43397c688b9583aa71e087c0576e5621740 (diff) | |
download | ellinika-7518cda05846fe76e026caaea82417ff4c19d40d.tar.gz ellinika-7518cda05846fe76e026caaea82417ff4c19d40d.tar.bz2 |
(locale-path): New public variable
(locale-dir): Removed
(ellinika-cgi-init): Use i18n to set-up localization
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@394 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'ellinika')
-rw-r--r-- | ellinika/cgi.scmi | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ellinika/cgi.scmi b/ellinika/cgi.scmi index c457ca6..b4da8f9 100644 --- a/ellinika/cgi.scmi +++ b/ellinika/cgi.scmi @@ -21,13 +21,14 @@ (define-module (ellinika cgi)) (use-modules (www cgi) - (gamma gettext)) + (gamma gettext) + (ellinika i18n)) ;;; User-definable variables (define-public base-dir "=PREFIX=") (define-public html-dir "=HTMLDIR=") (define-public sysconf-dir "=SYSCONFDIR=") -(define-public locale-dir "=LOCALEDIR=") +(define-public locale-path "=LOCALEDIR=:/usr/share/locale:/usr/local/share/locale") (define-public ref-loc #f) (define-public dict-cgi-path "cgi-bin/dict.cgi") @@ -138,14 +139,11 @@ THUNK. (cond ((cgi:value "LANG") => (lambda (x) - (if (and (file-exists? (template-file x template-file-name)) - (false-if-exception (setlocale LC_ALL x))) + (if (file-exists? (template-file x template-file-name)) (set! target-language x))))) - ;;; Initialize i18n - (setlocale LC_ALL target-language) - (bindtextdomain "=PACKAGE=" locale-dir) - (bind_textdomain_codeset "=PACKAGE=" "UTF-8") - (textdomain "=PACKAGE=")) + (let ((x (locale-setup target-language "=PACKAGE=" locale-path))) + (if x + (set! target-language x)))) ;;; End of cgi.scmi |