FAQ
Is it possible to have the admin interface for a list in 1 language,
English, and have the user interface a different language, French,
using 2.1.6 or 2.1.9?

The only thing I can come up with is to actually change the language
of the list to French, and edit the translation file and remove the
translations for the Admin interface so that it gets displayed in the
default text, which is English.

Is there an easier way to do this?

--
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well
preserved body, but rather to skid in sideways, totally worn out,
shouting "What a great ride!"

Search Discussions

  • Mark Sapiro at Jun 8, 2007 at 3:16 pm

    Bryan Carbonnell wrote:
    Is it possible to have the admin interface for a list in 1 language,
    English, and have the user interface a different language, French,
    using 2.1.6 or 2.1.9?

    The only thing I can come up with is to actually change the language
    of the list to French, and edit the translation file and remove the
    translations for the Admin interface so that it gets displayed in the
    default text, which is English.

    Is there an easier way to do this?

    I'm not sure if this is what you wan't, but you can set the list's
    default language to English, and make sure that French is an available
    language. Then users can set their preferred language to French.

    The tricky part is setting the default language for a new member to
    French. This would require implementing a new list attribute, e.g.,
    default_member_language, or a really ugly hack to Mailman/MailList.py
    in the ApprovedAddMember() method.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Bryan Carbonnell at Jun 8, 2007 at 3:29 pm

    On 6/8/07, Mark Sapiro wrote:
    Bryan Carbonnell wrote:
    Is it possible to have the admin interface for a list in 1 language,
    English, and have the user interface a different language, French,
    using 2.1.6 or 2.1.9?

    The only thing I can come up with is to actually change the language
    of the list to French, and edit the translation file and remove the
    translations for the Admin interface so that it gets displayed in the
    default text, which is English.

    Is there an easier way to do this?

    I'm not sure if this is what you wan't, but you can set the list's
    default language to English, and make sure that French is an available
    language. Then users can set their preferred language to French.

    The tricky part is setting the default language for a new member to
    French. This would require implementing a new list attribute, e.g.,
    default_member_language, or a really ugly hack to Mailman/MailList.py
    in the ApprovedAddMember() method.
    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.

    That is why I was looking for a way to have my cake and eat it too :)

    --
    Bryan Carbonnell - carbonnb at gmail.com
    Life's journey is not to arrive at the grave safely in a well
    preserved body, but rather to skid in sideways, totally worn out,
    shouting "What a great ride!"
  • Mark Sapiro at Jun 8, 2007 at 4:14 pm

    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
  • Bryan Carbonnell at Jun 8, 2007 at 5:23 pm

    On 6/8/07, Mark Sapiro wrote:
    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
    Thanks Mark, I'll give this a shot and report back

    --
    Bryan Carbonnell - carbonnb at gmail.com
    Life's journey is not to arrive at the grave safely in a well
    preserved body, but rather to skid in sideways, totally worn out,
    shouting "What a great ride!"
  • Mark Sapiro at Jun 10, 2007 at 11:55 pm

    Mark Sapiro wrote:
    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)

    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.

    Sorry for any confusion.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Mark Sapiro at Jun 11, 2007 at 12:09 am

    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
  • Bryan Carbonnell at Jun 11, 2007 at 6:34 pm

    On 6/10/07, Mark Sapiro wrote:
    Mark Sapiro wrote:
    Sorry, brain cramp. The above patch won't quite do. It needs to be
    Thanks for all this Mark.

    Even after all this, I didn't test it. It seems that I can't touch the
    MM source code with this installation :(

    So I will have to work out a different way.

    --
    Bryan Carbonnell - carbonnb at gmail.com
    Life's journey is not to arrive at the grave safely in a well
    preserved body, but rather to skid in sideways, totally worn out,
    shouting "What a great ride!"

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedJun 8, '07 at 2:30p
activeJun 11, '07 at 6:34p
posts8
users2
websitelist.org

2 users in discussion

Bryan Carbonnell: 4 posts Mark Sapiro: 4 posts

People

Translate

site design / logo © 2022 Grokbase