[Mailman-Users] Default Languages

Mark Sapiro msapiro at value.net
Fri Jun 8 18:14:17 CEST 2007


Bryan Carbonnell wrote:
>
>I don't want the user to have a choice in their default language.
>
>Here is the problem I have been running into, with the choice of
>English and French, when there user confirms their subscription, the
>confirmation page is in English, because that is the default.
>
>The user never gets a chance to see the confirmation in French.


To address the confirmation page, you could apply the following patch
to Mailman/Cgi/confirm.py

--- 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 NameError:
+        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)

You could than use bin/withlist or the following shell script to set
default_user_language for the target list.

#! /bin/bash
tf=`mktemp`
echo mlist.default_user_language = \'fr\' > $tf
bin/config_list -i $tf listname
rm $tf

You could also patch the the ApprovedAddMember() method in
Mailman/MailList.py in a similar way the set the member's language if
desired.

-- 
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