How to change the language in mailman3
Hi everyone, from here: https://hosted.weblate.org/projects/gnu-mailman/hyperkitty/it/ I see that there is a way to change the language of mailman3, postorius and hyperkitty But I don't find how. I read that you can download the .po files for the chosen language, but I didn't understand how to use these files. Could anyone show me how to do it?
Thank you in advance. Max
On 7/17/20 8:22 AM, maszap@tin.it wrote:
Hi everyone, from here: https://hosted.weblate.org/projects/gnu-mailman/hyperkitty/it/ I see that there is a way to change the language of mailman3, postorius and hyperkitty But I don't find how. I read that you can download the .po files for the chosen language, but I didn't understand how to use these files. Could anyone show me how to do it?
The various message catalogs for Mailman core are in mailman/messages/ and those for hyperkitty, django-mailman3 and postorius are respectively in hyperkitty/locale/, django-mailman3/locale/ and postorius/locale/.
The translations from weblate are incorporated in the distribution, but depending on how Mailman is installed, may be out of date.
To set language for Django (i.e. hyperkitty and postorius) see <https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#how-django-di...>.
For Mailman core, set [mailman] default_language:
in mailman.cfg. You
also need to (re)generate the .mo file which can be done with the
generate_mo.sh script. See
<https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/intern...>
For Django, you need to generate .mo files with
django_admin compilemessages
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi everyone, Mark thanks for the reply. My installation was done on Debian Buster by installing the mailman3-full package
I can't find the path you indicated:
Mailman core in mailman/messages/ Hyperkitty in hyperkitty/local/ django-mailman3 in django-mailman3/local/ postorius in postorius/local/ Maybe some packages are missing?
To set language for Django (i.e. hyperkitty and postorius) see https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#how-django-di.... What are the files to be edited?
For Mailman core, set [mailman] default_language: in mailman.cfg. Ok Done
You also need to (re)generate the .mo file which can be done with the generate_mo.sh script. I can't find the script
For Django, you need to generate .mo files with django_admin compilemessages Where should this be written?
Thank you Max
On 7/17/20 9:44 AM, Massimo Zappalà wrote:
Hi everyone, Mark thanks for the reply. My installation was done on Debian Buster by installing the mailman3-full package
I can't find the path you indicated:
Mailman core in mailman/messages/ Hyperkitty in hyperkitty/local/ django-mailman3 in django-mailman3/local/ postorius in postorius/local/ Maybe some packages are missing?
I doubt things are missing. I can't keep track of where all the
downstream packages put things, but look in /usr/lib/mailman and/or
/var/lib/mailman or use tools like find
or locate
.
To set language for Django (i.e. hyperkitty and postorius) see https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#how-django-di.... What are the files to be edited?
settings_local.py
For Mailman core, set [mailman] default_language: in mailman.cfg. Ok Done
You also need to (re)generate the .mo file which can be done with the generate_mo.sh script. I can't find the script
It probably isn't included in the Debian package. This is what it does.
#!/bin/bash
# This script generates .mo files from all the .po files in the source.
echo 'Generating mo files for GNU Mailman ...'
for file in find -name 'mailman.po'
do
echo $file
msgfmt $file -o ${file/po/mo} -v
done
For Django, you need to generate .mo files with django_admin compilemessages Where should this be written?
You give the compilemessages subcommand to whatever command you use for django-admin or manage.py or whatever the Debian package calls it.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi everyone, Debian buster run on my server. I installed the apt install mailman3-full package and configured it. Everything works fine. I'm trying to change the language (mailman3, postorius and hyperkitty) from English to Italian, but it's not clear what I'm missing. These are the files that I modified to try to set the Italian language:
/etc/mailman3/mailman.cfg default_language: it
/etc/mailman3/mailman-web.py LANGUAGE_CODE = 'it-IT' TIME_ZONE = 'Europe/Rome' USE_I18N = True USE_L10N = True USE_TZ = True
/usr/lib/python3/dist-packages/django/conf/global_settings.py TIME_ZONE = 'Europe/Rome' USE_TZ = True LANGUAGE_CODE = 'it-IT'
With this command, I set the Italian language to the list. It takes the setting, but it doesn't work sudo mailman shell -l test@pratico.work
m.preferred_language='it' commit() CTRL-D
Can anyone tell me what I'm missing? Thank you in advance
Max
On 7/20/20 5:19 PM, Massimo Zappalà wrote:
Hi everyone, Debian buster run on my server. I installed the apt install mailman3-full package and configured it. Everything works fine. I'm trying to change the language (mailman3, postorius and hyperkitty) from English to Italian, but it's not clear what I'm missing. These are the files that I modified to try to set the Italian language:
/etc/mailman3/mailman.cfg default_language: it
/etc/mailman3/mailman-web.py LANGUAGE_CODE = 'it-IT' TIME_ZONE = 'Europe/Rome' USE_I18N = True USE_L10N = True USE_TZ = True
Assuming this is the Debian packages Django settings file for mailman, it probably contains something like
try: from settings_local import * except ImportError: pass
at the end. You should put your local changes in the /etc/mailman3/settings_local.py file.
/usr/lib/python3/dist-packages/django/conf/global_settings.py TIME_ZONE = 'Europe/Rome' USE_TZ = True LANGUAGE_CODE = 'it-IT'
This probably isn't needed as it should be overridden by the above.
With this command, I set the Italian language to the list. It takes the setting, but it doesn't work sudo mailman shell -l test@pratico.work
m.preferred_language='it' commit() CTRL-D
Can anyone tell me what I'm missing?
The source distribution for Mailman core does not contain the compiled message catalogs, and Debian's package probably doesn't either.
Find the mailman/messages/it/LC_MESSAGES directory, cd to that directory and give the command
msgfmt mailman.po -o mailman.mo
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi everybody,
with $sudo updatedb $sudo locate,I don't find these path Mailman core in mailman/messages/ Hyperkitty in hyperkitty/local/ django-mailman3 in django-mailman3/local/ postorius in postorius/local/from here https://www.pratico.work/file.tar.xz you can download the following files: my file /usr/share/mailman3-web/settings_local.py $sudo locate it/LC_MESSAGES > mypath.txt I can't (re)generate the .mo files because there are no path above. Thank You for help Max
On 7/22/20 10:17 AM, blackout69 wrote:
Hi everybody,
with $sudo updatedb $sudo locate,I don't find these path Mailman core in mailman/messages/ Hyperkitty in hyperkitty/local/ django-mailman3 in django-mailman3/local/ postorius in postorius/local/from here https://www.pratico.work/file.tar.xz you can download the following files: my file /usr/share/mailman3-web/settings_local.py $sudo locate it/LC_MESSAGES > mypath.txt I can't (re)generate the .mo files because there are no path above. Thank You for help Max
I'm having trouble deciphering what you are saying, however, the actual paths you are looking for are:
For Mailman core: mailman/messages/it/LC_MESSAGES/mailman.po For HyperKitty: hyperkitty/locale/it/LC_MESSAGES/django.po For djangomailman3: django_mailman3/locale/it/LC_MESSAGES/django.po For Postorius: postorius/locale/it/LC_MESSAGES/django.po
Note 'locale', not 'local'
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi everyboby, this is my path found with locate
blackout69@gamelia:~$ sudo locate it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/allauth/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/conf/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/admin/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/admindocs/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/auth/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/contenttypes/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/flatpages/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/gis/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/humanize/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/postgres/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/redirects/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/sessions/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django/contrib/sites/locale/it/LC_MESSAGES/django.po /usr/lib/python3/dist-packages/django_extensions/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/conf/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/admin/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/admindocs/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/auth/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/contenttypes/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/flatpages/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/gis/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/humanize/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/postgres/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/redirects/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/sessions/locale/it/LC_MESSAGES/django.po /usr/share/python-django-common/django/contrib/sites/locale/it/LC_MESSAGES/django.po
Thank You Max
OK thanks, I solved it by creating the paths
/usr/lib/python3/dist-packages/mailman/locale/it/LC_MESSAGES /usr/lib/python3/dist-packages/django_mailman3/locale/it/LC_MESSAGES /usr/lib/python3/dist-packages/postorius/locale/it/LC_MESSAGES /usr/lib/python3/dist-packages/hyperkitty/locale/it/LC_MESSAGES
Then I run this command: sudo msgfmt django.po -o django.mo
Thank You for your support Max
On 7/22/20 2:45 PM, Massimo Zappalà wrote:
OK thanks, I solved it by creating the paths
/usr/lib/python3/dist-packages/mailman/locale/it/LC_MESSAGES /usr/lib/python3/dist-packages/django_mailman3/locale/it/LC_MESSAGES /usr/lib/python3/dist-packages/postorius/locale/it/LC_MESSAGES /usr/lib/python3/dist-packages/hyperkitty/locale/it/LC_MESSAGES
Then I run this command: sudo msgfmt django.po -o django.mo
Except, based on paths above, Mailman Core's message catalog is not /usr/lib/python3/dist-packages/mailman/locale/it/LC_MESSAGES/django.*. It is /usr/lib/python3/dist-packages/mailman/messages/it/LC_MESSAGES/mailman.*
There should already be a mailman.po there which can be translated with
msgfmt mailman.po -o mailman.mo
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I have the same problem. Also installed from Debian packages (for buster). I have mailman.po in /var/lib/mailman/messages/de/LC_MESSAGES and django.po in /usr/share/python-django-common/django/conf/locale/de/LC_MESSAGES. While I can translate django.po to django.mo, the same with mailman.po just gives back the error mailman.po:7111: »msgid«- und »msgstr«-Eintrag enden nicht jeweils mit »\n« msgfmt: es ist 1 fataler Fehler aufgetreten
(somewhere msgid and msgstr dont end with \n) But the File is way too huge to find out where it's missing. Considering "7111" is a line number it does make the search easier. but still I just can't see where the \n is missing.
Richard Rosner writes:
I have the same problem. Also installed from Debian packages (for buster). I have mailman.po in /var/lib/mailman/messages/de/LC_MESSAGES and django.po in /usr/share/python-django-common/django/conf/locale/de/LC_MESSAGES. While I can translate django.po to django.mo, the same with mailman.po just gives back the error mailman.po:7111: »msgid«- und »msgstr«-Eintrag enden nicht jeweils mit »\n« msgfmt: es ist 1 fataler Fehler aufgetreten
(somewhere msgid and msgstr dont end with \n)
'msgid' should be in English, I think. Does 'msgstr' end with a non-ASCII character (ignoring the trailing newline that seems to be there, if I understand correctly)?
I'm thinking that in Mailman 2, the German translations were almost certainly encoded as a one-byte code, either ISO-8859-1 or ISO-8859-15, but if msgfmt is expecting UTF-8 and the line ends with an accented character or sharp S, it may think that's introducing a multibyte character, and gobble up the newline.
I think the file(1) utility on Linux is smart enough to detect UTF-8 text and tell you so. Not sure how msgfmt thinks about encodings anymore, it's been a long while since I used it directly.
Steve
Stephen J. Turnbull wrote:
'msgid' should be in English, I think. Does 'msgstr' end with a non-ASCII character (ignoring the trailing newline that seems to be there, if I understand correctly)?
That's right, but I can't see any of that kind. But it does include some typical german characters.
I'm thinking that in Mailman 2, the German translations were almost certainly encoded as a one-byte code, either ISO-8859-1 or ISO-8859-15, but if msgfmt is expecting UTF-8 and the line ends with an accented character or sharp S, it may think that's introducing a multibyte character, and gobble up the newline. I think the file(1) utility on Linux is smart enough to detect UTF-8 text and tell you so. Not sure how msgfmt thinks about encodings anymore, it's been a long while since I used it directly. Steve
Also true. The file is ISO-8859-1 encoded. I was able to convert it to utf-8, but the error is still the same.
participants (6)
-
blackout69
-
Mark Sapiro
-
Massimo Zappalà
-
maszap@tin.it
-
Richard Rosner
-
Stephen J. Turnbull