Sorry. I didn't see in the good place. when i see parameters here : https://URL/mailman3/postorius/accounts/per-subscription-preferences/ the options or the specific language chosen (not for the ui) for the list is finally changing when i use the code used before...
i should use shell with mailman user. ok i note it.
I ve seen this link about python script to manage mailman3 by shell : https://fog.ccsf.edu/~msapiro/scripts/ (thx you)
Regards,
On 23/09/2023 17:33, Mark Sapiro wrote:
On 9/23/23 07:40, testeur via Mailman-users wrote:
|# mailman shell -l testlist@domain.tld |
It looks like you are running
mailman shell
asroot
. You should always run mailman commands including starting mailman as the Mailman user, never as root. Running thing as root can create things that later can't be read by the mailman user.||>>> from mailman.interfaces.action import Action >>> for mbr in m.members.members: mbr.moderation_action = Action.defer |||commit()|
|||>>> from mailman.interfaces.action import Action |||||||>>> english = getUtility(ILanguageManager).get('en')| >>> for mbr in m.members.members: || mbr.preferences.acknowledge_posts = False mbr.preferences.delivery_mode = DeliveryMode.regular mbr.preferences.delivery_status = DeliveryStatus.enabled mbr.preferences.hide_address = False mbr.preferences.preferred_language = english mbr.preferences.receive_list_copy = False mbr.preferences.receive_own_postings = True|commit()||
I'm not sure what the above actually says. The interaction should look like
>>> from mailman.interfaces.action import Action >>> english = getUtility(ILanguageManager).get('en') >>> for mbr in m.members.members: ... mbr.preferences.acknowledge_posts = False ... mbr.preferences.delivery_mode = DeliveryMode.regular ... mbr.preferences.delivery_status = DeliveryStatus.enabled ... mbr.preferences.hide_address = False ... mbr.preferences.preferred_language = english ... mbr.preferences.receive_list_copy = False ... mbr.preferences.receive_own_postings = True ... >>> commit()
Actually, importing Action is not necessary as it is among the things defined by default in
mailman shell
in interactive mode.Before the shell command, the web interface was with an other language (i tested with italian one) and other options preferences, but after the shell command, after a web interface refresh, it doesn't change.
The above shell interaction sets the preferred_language for all list members to english. This has nothing to do with the language for the web UI. This is set by Django. See <https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#how-django-discovers-language-preference>.