Mailman core: basic internationalization howto?
I would like to use Norwegian in the welcome/subscribe/unsubscribe/confirm etc messages from mailman3. For my current project I want all future mailing lists to have Norwegian as default. I find some sporadic info on the subject, but it's fair to say that I would like some simple instructions (e.g. what to copy from where to where, and which configs to change).
On Oct 4, 2017, at 04:55, Thor Atle Rustad <thor.rustad@gmail.com> wrote:
I would like to use Norwegian in the welcome/subscribe/unsubscribe/confirm etc messages from mailman3. For my current project I want all future mailing lists to have Norwegian as default. I find some sporadic info on the subject, but it's fair to say that I would like some simple instructions (e.g. what to copy from where to where, and which configs to change).
I18n for Mailman 3 isn’t really feasible right now. There’s a lot of underlying support for it in the code base, but what we’ve lacked is the resources to set up all the translations, extract the source strings from the code and templates, and integrate the catalogs. We usually block on the selection of a translation service that adheres enough to the free software ideals for a GNU project like Mailman, and someone with the free time and inclination to help shepherd the work.
Recently it was suggested to use translatewiki.net, which seems like it would be acceptable from a GNU view point. Many of us would be willing to help set up such a thing, but we need a champion who has time to work out all the details. Given that Mailman 2 was one of the first fully i18n’d Python programs in the world, it is an important project goal to translate Mailman 3.
Cheers, -Barry
I found something that can be of use to me, just to change the outgoing emails like confirmation emails and such. It's located under var/templates/site/<language>. I just copy the "en" folder and change whatever I like. I wish this folder structure would have been included by default, it would have saved me a lot of time guessing and testing. I'm sure I will have surprises as I go along, but at least I have started.
Coincidentally, I got this tip from another thread that was answered a couple of days ago (https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...) , but I guess google spamfiltered the mail. I never received it.
I finally got around to testing this setup. First I verified that the template in /var/templates/site/no was picked up when subscribing. Then I changed the text, and it stopped working. If I add one of these three Norwegian letters to list:user:action:subscribe.txt, I get the following in logs/mailman.log:
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 153: ordinal not in range(128)
Oct 04 19:18:41 2017 (29) Uncaught runner exception: 'ascii' codec can't encode character '\xe5' in position 153: ordinal not in range(128)
Oct 04 19:18:41 2017 (29) Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/mailman/core/runner.py", line 171, in _one_iteration
self._process_one_file(msg, msgdata)
File "/usr/local/lib/python3.6/site-packages/mailman/core/runner.py", line 264, in _process_one_file
keepqueued = self._dispose(mlist, msg, msgdata)
File "/usr/local/lib/python3.6/site-packages/mailman/runners/command.py", line 196, in _dispose
mlist, msg, msgdata, parts, results)
File "/usr/local/lib/python3.6/site-packages/mailman/commands/eml_membership.py", line 104, in process
ISubscriptionManager(mlist).register(subscriber)
File "/usr/local/lib/python3.6/site-packages/mailman/app/subscriptions.py", line 520, in register
list(workflow)
File "/usr/local/lib/python3.6/site-packages/mailman/app/workflow.py", line 69, in __next__
return step()
File "/usr/local/lib/python3.6/site-packages/mailman/app/subscriptions.py", line 336, in _step_send_confirmation
self.mlist, self.token, self.address.email))
File "/usr/local/lib/python3.6/site-packages/zope/event/__init__.py", line 32, in notify
subscriber(event)
File "/usr/local/lib/python3.6/site-packages/mailman/app/subscriptions.py", line 584, in handle_SubscriptionConfirmationNeededEvent
_handle_confirmation_needed_events(event, 'list:user:action:subscribe')
File "/usr/local/lib/python3.6/site-packages/mailman/app/subscriptions.py", line 576, in _handle_confirmation_needed_events
msg = UserNotification(email_address, confirm_address, subject, text)
File "/usr/local/lib/python3.6/site-packages/mailman/email/message.py", line 124, in __init__
@public
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 153: ordinal not in range(128)
Oct 04 19:18:41 2017 (29) SHUNTING: 1507144721.896973+35dc93aa969a0934bf717ca07965b09924eca59d
~
On 10/04/2017 12:33 PM, thor.rustad@gmail.com wrote:
I finally got around to testing this setup. First I verified that the template in /var/templates/site/no was picked up when subscribing. Then I changed the text, and it stopped working. If I add one of these three Norwegian letters to list:user:action:subscribe.txt, I get the following in logs/mailman.log:
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 153: ordinal not in range(128)
Oct 04 19:18:41 2017 (29) Uncaught runner exception: 'ascii' codec can't encode character '\xe5' in position 153: ordinal not in range(128)
...
File "/usr/local/lib/python3.6/site-packages/mailman/app/subscriptions.py", line 576, in _handle_confirmation_needed_events
msg = UserNotification(email_address, confirm_address, subject, text)
File "/usr/local/lib/python3.6/site-packages/mailman/email/message.py", line 124, in __init__
@public
???
UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 153: ordinal not in range(128)
Oct 04 19:18:41 2017 (29) SHUNTING: 1507144721.896973+35dc93aa969a0934bf717ca07965b09924eca59d
See my comment at <https://gitlab.com/mailman/mailman/issues/413#note_42453740>.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Barry Warsaw
-
Mark Sapiro
-
Thor Atle Rustad
-
thor.rustad@gmail.com