Hi everyone,
Thanks to Brian I'm up and running with my migrated mailman3 lists and am now starting to get into customising the interface (styling and content). I've been trying to figure out how to set/change the Postorius locale - I specifically want to change some text strings on the info page without breaking the i18n mechanisms. I've worked with po and mo files before, so changing and compiling them isn't a problem. The problems I've encountered so far are:
- Where do I set the local of the Postorius interface?
- Individual lists have a language setting, but it doesn't seem to reflect what the Postorius locales are as the only english option is "English (USA)" and none of the other English speaking locales and on the file system there is no en-us PO files....so I suspect I'm looking in the wrong place.
Am I looking at this all wrong? The documentation doesn't seem to have any info about this and yet the mechanisms seem to be there.
Once I learn more I'm quite keen to start working on improving the documentation based on what I learn.
Cheers,
Duane
On 3/2/21 7:55 AM, Duane Raymond wrote:
The problems I've encountered so far are:
- Where do I set the local of the Postorius interface?
- Individual lists have a language setting, but it doesn't seem to reflect what the Postorius locales are as the only english option is "English (USA)" and none of the other English speaking locales and on the file system there is no en-us PO files....so I suspect I'm looking in the wrong place.
Multiple things are required.
In order to be able to set the list's preferred_language via Postorius,
the language must be included in the LANGUAGES definition in
postorius/utils.py. However, you can set the list's preferred_language
in Mailman core via REST
or mailman shell
or direct update of the
database.
Then there must be message catalogs for the language in
postorius/locale, django_mailman3/locale and hyperkitty/locale and these
must be compiled by the Django management command compilemessages
.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Tue, Mar 2, 2021, at 7:55 AM, Duane Raymond wrote:
Hi everyone,
Thanks to Brian I'm up and running with my migrated mailman3 lists and am now starting to get into customising the interface (styling and content). I've been trying to figure out how to set/change the Postorius locale - I specifically want to change some text strings on the info page without breaking the i18n mechanisms. I've worked with po and mo files before, so changing and compiling them isn't a problem. The problems I've encountered so far are:
- Where do I set the local of the Postorius interface?
The installation has a default Language setting which you can set in the settings.py
LANGUAGE_CODE = "en"
- Individual lists have a language setting, but it doesn't seem to reflect what the Postorius locales are as the only english option is "English (USA)" and none of the other English speaking locales and on the file system there is no en-us PO files....so I suspect I'm looking in the wrong place.
List level settings affect the Mailman level emails that go out, not the interface.
The users can choose which language the interface shows up in using their browser settings. We primarily depend on the Accept-Language header in the request to determine the language of the response.
While users do have a preffered-language setting, it currently isn't used to determine the language of the UI. Like list setting, it is only used to determine the language of the emails sent out (user's preferences override the list's default language).
Am I looking at this all wrong? The documentation doesn't seem to have any info about this and yet the mechanisms seem to be there.
Once I learn more I'm quite keen to start working on improving the documentation based on what I learn.
Cheers,
Duane
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
Thanks - here is where that got ne so far...
I have set the modest goal of changing a string on the list subscription page from the form label "Your name (optional)" to "Your name (and organisation)"
What I did was
I edited /opt/mailman/mm/settings.py and changed the LANGUAGE_CODE from 'en-us' to 'en-gb' (or should I do it at /opt/mailman/mm/venv/lib/python3.7/site-packages/falcon/bench/dj/dj/settings.py or another location?)
Then I switched user using "su mailman" and started the venv environment (using: source /opt/mailman/mm/venv/bin/activate)
I edit the po file at /opt/mailman/mm/venv/lib/python3.7/site-packages/postorius/locale/ and specifically I am testing it on editing en_GB/LC_MESSAGES/django.po - is this the correct location?
I run: mm/venv/lib/python3.7/site-packages/falcon/bench/dj/manage.py compilemessages - is this the correct one to run? After this, nothing changed on the list page yet.
After that I changed directory into "/opt/mailman/mm/static" and run python ./mm/venv/lib/python3.7/site-packages/falcon/bench/dj/manage.py collectstatic - but this produces an error about ROOT_STATIC not being set
...and I didn't want to fiddle too much in case I overwrote the current functioning site ;-)
Is the collectstatic static necessary after running compilemessages? Am I using the right files to run it? Am I editing them in the right location?
Cheers,
Duane
Hi everyone,
I seem to have got this working following most of the process above and then restarting restart mailman, qcluster and gunicorn - not sure which of these made the difference I was a trying a number of things.
I'll now try and repeat the process and narrow down my steps to document exactly how to do this and am then happy to share documentation on it for others (and for review in case the steps are different on other systems).
So thanks for your hints on how to get started on this - it helped me find a way that works!
Cheers,
Duane
participants (3)
-
Abhilash Raj
-
Duane Raymond
-
Mark Sapiro