On Oct 6, 2017, at 16:19, Thor Atle Rustad <thor.rustad@gmail.com> wrote:
When I make a new list, the list's language is English/us-ascii. However, it will choose the templates from the site/no directory. So it chooses the correct template for my site preferences, but the list has the wrong language. Mailman reports Norwegian as default language. Is all language related setup in files? Should I check postgresql for language settings?
The mailing list’s language is initially assigned from the style that is applied, specifically the preferred_language
attribute. By default, we ship a ‘legacy-default’ style which as you’ve guessed, assigns ‘en’ to the language.
So the way this will work is that you want to create a new style which will be the same as ‘legacy-default’ but sets the language to ‘no’. Something like the following (untested):
from mailman.interfaces.styles import IStyle
from mailman.styles.base import (
BasicOperation, Bounces, Discussion, Identity, Moderation, Public)
from public import public
from zope.interface import implementer
@public
@implementer(IStyle)
class NOStyle(Identity, BasicOperation, Bounces, Public, Discussion, Moderation):
name = ’no-default'
def apply(self, mailing_list):
"""See `IStyle`."""
Identity.apply(self, mailing_list)
BasicOperation.apply(self, mailing_list)
Bounces.apply(self, mailing_list)
Public.apply(self, mailing_list)
Discussion.apply(self, mailing_list)
Moderation.apply(self, mailing_list)
mailing_list.preferred_language = ‘no’
Then in your mailman.cfg:
[styles]
default: no-default
The last thing is that you have to arrange for your NOStyle module to get imported at the right time. See http://mailman.readthedocs.io/en/latest/src/mailman/plugins/docs/intro.html for details, but understand that that only works for git master (i.e. what will be Mailman 3.2).
Let us know how it goes. Using plugins for extending the set of default styles isn’t well tested, but if it doesn’t work, I’d consider that a bug.
Cheers, -Barry