aboutsummaryrefslogtreecommitdiffhomepage
path: root/phox
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2012-04-06 07:05:41 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2012-04-06 07:05:41 +0000
commit6547eb96bf42414daecb28ad1dc65ad5cf66044e (patch)
tree78f71af8cee9776d57401ed37bb412ed86c634eb /phox
parentb657e54f428d4cd74a9a58c9979a98dc28cfc60d (diff)
Fix compile error, Trac #437.
Diffstat (limited to 'phox')
-rw-r--r--phox/phox-lang.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/phox/phox-lang.el b/phox/phox-lang.el
index a83328b8..dc6ad9ed 100644
--- a/phox/phox-lang.el
+++ b/phox/phox-lang.el
@@ -7,13 +7,17 @@
(require 'cl) ; for case
(defvar phox-lang
- (let* ((s1 (getenv "LANG")) (s2 (getenv "LC_LANG")) (s (substring (if s1 s1 (if s2 s2 "en")) 0 2)))
+ (let* ((s (or (getenv "LC_ALL")
+ (getenv "LANG")
+ (getenv "LANGUAGE")))
+ (loc (and s
+ (> (length s) 1)
+ (substring s 0 2))))
(cond
- ((or (string= s "en") (string= s "us")) 'en)
- ((string= s "fr") 'fr)
+ ((or (string= loc "en") (string= loc "us")) 'en)
+ ((string= loc "fr") 'fr)
(t 'en))))
-
(defun phox-lang-absurd ()
(case phox-lang
(en "By absurd")