From 6547eb96bf42414daecb28ad1dc65ad5cf66044e Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Fri, 6 Apr 2012 07:05:41 +0000 Subject: Fix compile error, Trac #437. --- phox/phox-lang.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'phox') 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") -- cgit v1.2.3