diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-04-15 06:56:04 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-04-15 06:56:04 +0000 |
commit | a72a6a1666ca29de3e9d0fb01a64ada20905674f (patch) | |
tree | dce073bcf72de45952c467f402c16a3273a2ccfd | |
parent | 9a08d61db5b88828bf0ebddf153a7ec202e70a0c (diff) | |
download | ellinika-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.scm | 79 | ||||
-rw-r--r-- | xml/lingua.conf.in | 2 |
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 | |||
@@ -253,47 +253,52 @@ | |||
253 | (access? (string-append name ".gmo") R_OK)) | 253 | (access? (string-append name ".gmo") R_OK)) |
254 | (return dir)))) | 254 | (return dir)))) |
255 | (string-split locale-path #\:)) | 255 | (string-split locale-path #\:)) |
256 | #f))) | 256 | #f))) |
257 | 257 | ||
258 | (define (locale-setup lang domain-name locale-path) | 258 | (define (locale-setup lang domain-name locale-path) |
259 | (cond | 259 | (catch 'system-error |
260 | ((not lang) | 260 | (lambda () |
261 | (setenv "LC_ALL" "C") | 261 | (cond |
262 | (setlocale LC_ALL "C") | 262 | ((not lang) |
263 | #f) | 263 | (setenv "LC_ALL" "C") |
264 | (else | 264 | (setlocale LC_ALL "C") |
265 | (let ((curlocale (if (> (string-length lang) 2) | 265 | #f) |
266 | (string-downcase (substring lang 0 2)) | 266 | (else |
267 | lang)) | 267 | (let ((curlocale (if (> (string-length lang) 2) |
268 | (terr #f) | 268 | (string-downcase (substring lang 0 2)) |
269 | (sublocale #f) | 269 | lang)) |
270 | (domaindir #f)) | 270 | (terr #f) |
271 | 271 | (sublocale #f) | |
272 | (cond | 272 | (domaindir #f)) |
273 | ((and (> (string-length lang) 2) (char=? (string-ref lang 2) #\-)) | 273 | |
274 | (set! terr (string-upcase (substring lang 3 2))) | 274 | (cond |
275 | (set! sublocale (string-append curlocale "_" terr))) | 275 | ((and (> (string-length lang) 2) (char=? (string-ref lang 2) #\-)) |
276 | ((assoc-ref defterr (string->symbol curlocale)) => | 276 | (set! terr (string-upcase (substring lang 3 2))) |
277 | (lambda (elt) | 277 | (set! sublocale (string-append curlocale "_" terr))) |
278 | (set! sublocale curlocale) | 278 | ((assoc-ref defterr (string->symbol curlocale)) => |
279 | (set! terr elt))) | 279 | (lambda (elt) |
280 | (else | 280 | (set! sublocale curlocale) |
281 | (set! sublocale curlocale) | 281 | (set! terr elt))) |
282 | (set! terr "XX"))) ; Hack for languages without defined territory. | 282 | (else |
283 | 283 | (set! sublocale curlocale) | |
284 | (let ((domaindir (supported-locale-dir sublocale domain-name locale-path))) | 284 | (set! terr "XX"))) ; Hack for languages without defined territory. |
285 | (cond | 285 | |
286 | (domaindir | 286 | (let ((domaindir |
287 | (let ((locale (string-append curlocale "_" terr ".UTF-8"))) | 287 | (supported-locale-dir sublocale domain-name locale-path))) |
288 | (setenv "LC_ALL" locale) | 288 | (cond |
289 | (setlocale LC_ALL locale) | 289 | (domaindir |
290 | (textdomain domain-name) | 290 | (let ((locale (string-append curlocale "_" terr ".UTF-8"))) |
291 | (bindtextdomain domain-name domaindir) | 291 | (setenv "LC_ALL" locale) |
292 | locale)) | 292 | (setlocale LC_ALL locale) |
293 | ((setenv "LC_ALL" "C") | 293 | (textdomain domain-name) |
294 | (setlocale LC_ALL "C") | 294 | (bindtextdomain domain-name domaindir) |
295 | #f))))))) | 295 | locale)) |
296 | ((setenv "LC_ALL" "C") | ||
297 | (setlocale LC_ALL "C") | ||
298 | #f))))))) | ||
299 | (lambda args | ||
300 | #f))) | ||
296 | 301 | ||
297 | 302 | ||
298 | 303 | ||
299 | 304 | ||
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 | |||
@@ -66,13 +66,13 @@ | |||
66 | (car lang) | 66 | (car lang) |
67 | rest | 67 | rest |
68 | (cdr lang)))))) | 68 | (cdr lang)))))) |
69 | '(("pl" . "Polski") | 69 | '(("pl" . "Polski") |
70 | ("ru" . "Русский") | 70 | ("ru" . "Русский") |
71 | ("uk" . "Українська")))) | 71 | ("uk" . "Українська")))) |
72 | (display "</li></ul></ul>"))) | 72 | (display "</ul></li></ul>"))) |
73 | #f | 73 | #f |
74 | ]]> | 74 | ]]> |
75 | </GUILE> | 75 | </GUILE> |
76 | </CONFIG> | 76 | </CONFIG> |
77 | 77 | ||
78 | <!-- Local Variables: --> | 78 | <!-- Local Variables: --> |