                            J      	   ]          }         ¨  ¶lynx-preflang.patchTEXT                            ¾JŠ¾JļKm ¾Tdiff -ruN lynx2-8-7/src/LYMain.c lynx2-8-7-patch/src/LYMain.c
--- lynx2-8-7/src/LYMain.c	2006-11-12 20:29:33.000000000 -0500
+++ lynx2-8-7-patch/src/LYMain.c	2007-04-22 15:41:55.000000000 -0400
@@ -1126,7 +1126,18 @@
     StrAllocCopy(personal_type_map, PERSONAL_MAILCAP);
     StrAllocCopy(global_extension_map, GLOBAL_EXTENSION_MAP);
     StrAllocCopy(personal_extension_map, PERSONAL_EXTENSION_MAP);
-    StrAllocCopy(language, PREFERRED_LANGUAGE);
+
+    if ((cp = LYGetEnv("LANGUAGE")) != NULL) {
+      StrAllocCopy(language, cp);
+      cp = language;
+      while ((cp = strpbrk(cp, ":"))) *cp = ',';
+    } else if ((cp = LYGetEnv("LANG")) != NULL) {
+      StrAllocCopy(language, cp);
+      if ((cp = strpbrk(language, "."))) *cp = '\0';
+    } else {
+      StrAllocCopy(language, PREFERRED_LANGUAGE);
+    }
+
     StrAllocCopy(pref_charset, PREFERRED_CHARSET);
     StrAllocCopy(system_mail, SYSTEM_MAIL);
 #ifdef SYSTEM_MAIL_FLAGS
diff -ruN lynx2-8-7/lynx.cfg lynx2-8-7-patch/lynx.cfg
--- lynx2-8-7/lynx.cfg	2006-11-12 20:29:33.000000000 -0500
+++ lynx2-8-7-patch/lynx.cfg	2007-04-22 16:17:22.000000000 -0400
@@ -545,7 +545,8 @@
 # "fr") which will be indicated by Lynx in its Accept-Language headers
 # as the preferred language.  If available, the document will be
 # transmitted in that language.  Users can override this setting via
-# the 'o'ptions menu and save that preference in their RC file.
+# the LANG or LANGUAGE envrionment variables or via the 'o'ptions
+# menu and save that preference in their RC file.
 # This may be a comma-separated list of languages in decreasing preference.
 #
 #PREFERRED_LANGUAGE:en
diff -ruN lynx2-8-7/lynx.hlp lynx2-8-7-patch/lynx.hlp
--- lynx2-8-7/lynx.hlp	2006-10-12 19:00:01.000000000 -0400
+++ lynx2-8-7-patch/lynx.hlp	2007-04-22 16:22:11.000000000 -0400
@@ -923,14 +923,16 @@
        settings:
 
        LANG                This  variable,  if  set, will override the default
-                           message language.  It is an ISO 639 two-letter code
-                           identifying  the  language.  Language codes are NOT
-                           the same as the country codes given in ISO 3166.
+                           message language  and  PREFERRED_LANGUAGE  setting.
+                           It is an ISO 639 two-letter  code  identifying  the
+                           language.  Language codes are NOT the same  as  the
+                           country codes given in ISO 3166.
 
        LANGUAGE            This variable, if set, will  override  the  default
-                           message language.  This is a GNU extension that has
-                           higher priority for  setting  the  message  catalog
-                           than LANG or LC_ALL.
+                           message language  and  PREFERRED_LANGUAGE  setting.
+                           This is a GNU extension that  has  higher  priority
+                           for  setting  the  message  catalog  than  LANG  or
+                           LC_ALL.
 
        LC_ALL              and
 
diff -ruN lynx2-8-7/lynx.man lynx2-8-7-patch/lynx.man
--- lynx2-8-7/lynx.man	2006-10-12 19:00:01.000000000 -0400
+++ lynx2-8-7-patch/lynx.man	2007-04-22 16:24:43.000000000 -0400
@@ -1040,14 +1040,15 @@
 The following environment variables may be used to alter default settings:
 .TP 20
 .B LANG
-This variable, if set, will override the default message language.  It
-is an \fBISO 639\fR two-letter code identifying the language.  Language
-codes are \fBNOT\fR the same as the country codes given in \fBISO 3166\fR.
+This variable, if set, will override the default message language and
+PREFERRED_LANGUAGE setting.  It is an \fBISO 639\fR two-letter code
+identifying the language.  Language codes are \fBNOT\fR the same as the
+country codes given in \fBISO 3166\fR.
 .TP
 .B LANGUAGE
-This variable, if set, will override the default message language.
-This is a \fBGNU\fR extension that has higher priority for setting
-the message catalog than \fBLANG\fR or \fBLC_ALL\fR.
+This variable, if set, will override the default message language and
+PREFERRED_LANGUAGE setting. This is a \fBGNU\fR extension that has higher
+priority for setting the message catalog than \fBLANG\fR or \fBLC_ALL\fR.
 .TP
 .B LC_ALL
 and
diff -ruN lynx2-8-7/lynx_help/keystrokes/environments.html lynx2-8-7-patch/lynx_help/keystrokes/environments.html
--- lynx2-8-7/lynx_help/keystrokes/environments.html	2004-05-23 18:59:56.000000000 -0400
+++ lynx2-8-7-patch/lynx_help/keystrokes/environments.html	2007-04-22 16:29:56.000000000 -0400
@@ -280,17 +280,19 @@
        default settings:
 
        LANG                This variable, if set,  will  override
-                           the  default  message language.  It is
-                           an ISO 639 two-letter code identifying
+                           the  default  message   language   and
+                           PREFERRED_LANGUAGE setting.  It is  an
+                           ISO 639  two-letter  code  identifying
                            the  language.  Language codes are NOT
                            the same as the country codes given in
                            ISO 3166.
 
-       LANGUAGE            This  variable,  if set, will override
-                           the default message language.  This is a
-                           GNU extension that has higher priority for
-                           setting the message catalog than LANG or
-                           LC_ALL.
+       LANGUAGE            This variable, if set,  will  override
+                           the  default  message   language   and
+                           PREFERRED_LANGUAGE setting.  This is a
+                           GNU extension that has higher priority
+                           for setting the message  catalog  than
+                           LANG or LC_ALL.
 
        LC_ALL              and
 
diff -ruN lynx2-8-7/userdefs.h lynx2-8-7-patch/userdefs.h
--- lynx2-8-7/userdefs.h	2006-11-12 20:29:33.000000000 -0500
+++ lynx2-8-7-patch/userdefs.h	2007-04-22 16:10:09.000000000 -0400
@@ -716,9 +716,10 @@
  * "fr") which will be indicated by Lynx in its Accept-Language headers
  * as the preferred language.  If available, the document will be
  * transmitted in that language.  This definition can be overridden via
- * lynx.cfg.  Users also can change it via the 'o'ptions menu and save
- * that preference in their RC file.  This may be a comma-separated list
- * of languages in decreasing preference.
+ * the LANG/LANGUAGE enviroment variables or via lynx.cfg.  Users also
+ * can change it via the 'o'ptions menu and save that preference in
+ * their RC file.  This may be a comma-separated list of languages in
+ * decreasing preference.
  */
 #define PREFERRED_LANGUAGE "en"
 
