[Mailman-Users] Default Languages

Mark Sapiro msapiro at value.net
Mon Jun 11 02:09:10 CEST 2007


Mark Sapiro wrote:
>
>Sorry, brain cramp. The above patch won't quite do. It needs to be
>
>--- Mailman/Cgi/confirm.py      2007-05-07 15:34:26.593750000 -0700
>+++ Mailman/Cgi/confirmx.py     2007-06-08 08:47:46.000000000 -0700
>@@ -66,8 +66,12 @@
>         return
>
>     # Set the language for the list
>-    i18n.set_language(mlist.preferred_language)
>-    doc.set_language(mlist.preferred_language)
>+    try:
>+        p_l = mlist.default_user_language
>+    except AttributeError:
>+        p_l = mlist.preferred_language
>+    i18n.set_language(p_l)
>+    doc.set_language(p_l)
>
>I.e., the exception if the list doesn't have a default_user_language
>attribute is AttributeError, not NameError.


Wow! I seem to be having a real problem getting this right. The above
patch has the correct modification in it, but I managed to not include
the trailing context. The original had this problem too.

Here is the complete, correct (I hope) patch.

--- confirm.py  2007-05-07 15:34:26.593750000 -0700
+++ confirmx.py 2007-06-10 17:02:50.687500000 -0700
@@ -66,8 +66,12 @@
         return

     # Set the language for the list
-    i18n.set_language(mlist.preferred_language)
-    doc.set_language(mlist.preferred_language)
+    try:
+        p_l = mlist.default_user_language
+    except AttributeError:
+        p_l = mlist.preferred_language
+    i18n.set_language(p_l)
+    doc.set_language(p_l)

     # Get the form data to see if this is a second-step confirmation
     cgidata = cgi.FieldStorage(keep_blank_values=1)


-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list