From tkikuchi@is.kochi-u.ac.jp Tue May 1 09:10:13 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Tue, 01 May 2001 17:10:13 +0900 Subject: [Mailman-i18n] i18n needs more patch Message-ID: <3AEE6F65.D8F56B49@is.kochi-u.ac.jp> Hi, I was working on Japanese translation of i18n mailman catalog and found some sentenses are impossible to be translated because they are splitted in small pieces. I submitted a critical patch to sourceforge and would be happy if you can integrate into next alpha release. https://sourceforge.net/tracker/index.php?func=detail&aid=420396&group_id=103&atid=300103 Regards, Tokio From tkikuchi@is.kochi-u.ac.jp Wed May 2 08:35:14 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Wed, 02 May 2001 16:35:14 +0900 Subject: [Mailman-i18n] i18n needs more patch References: <3AEE6F65.D8F56B49@is.kochi-u.ac.jp> Message-ID: <3AEFB8B2.5E0D9BD4@is.kochi-u.ac.jp> Hi! Mailman/Cgi/handle_opts.py does not translate! apply this patch. Tokio --- mailman+orig/Mailman/Cgi/handle_opts.py Fri Apr 27 12:11:42 2001 +++ mailman/Mailman/Cgi/handle_opts.py Wed May 2 16:11:15 2001 @@ -27,7 +27,12 @@ from Mailman import Errors from Mailman.htmlformat import * from Mailman.Logging.Syslog import syslog -from Mailman.i18n import _ +from Mailman import i18n + +# Set up i18n +_ = i18n._ +i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) + From jcrey@uma.es Wed May 2 09:53:46 2001 From: jcrey@uma.es (Juan Carlos Rey Anaya) Date: Wed, 02 May 2001 10:53:46 +0200 Subject: [Mailman-i18n] Re: Tiny help References: <20010502090733.B3904@freemail.hu> Message-ID: <3AEFCB1A.C520A159@uma.es> Vizi Szilard wrote: > = > I am updating the hungarian catalog, but there are some problems. > = > The first is: The commandline programs do not use right now the > translation, although I inserted the DEFAULT_SERVER_LANGUAGE=3D'hu' > in the mm_cgf.py file. I want to see the hungarian messages in > the commandline programs, what should I do? I have discovered why, you must set explicitly language to translate into. test in bin/version.py: import paths import Mailman.mm_cfg from Mailman.i18n import _, set_language set_language(Mailman.mm_cfg.DEFAULT_SERVER_LANGUAGE) print _('Using Mailman version:'), Mailman.mm_cfg.VERSION I suppose all scripts in bin must be changed. > = > And I found some errors: > - the footer added to every message is still untranslated, Note it is hard coded in admin pages. mailman only takes what you write. > - all the commandline programs are writing english messages to the stdo= ut > - the list archive page is still in english Yes, it is a work to be done. I found it very difficult to translate, because the process of archive generation :-( You can try it ;-) I think that the proper persons to do it are mailman managers. > = > And a suggestion: > It would be better if definite articles (a, an) could be changed whenev= er > it is needed for the next word. In another way: > - before every word that starting with a vowel (a, e, i, o, u, etc.) > the article should be 'an', but > - before a starting consonant (b, c, d, g, etc.) the article=3D'a' > For example: > #: /home/mailman/Mailman/Cgi/listinfo.py:112 > msgid " mailing lists on %(hostname)s." > msgstr " levelez=E9si list=E1k a(z) %(hostname)s g=E9pen." <- right= now > msgstr " levelez=E9si list=E1k %(article)s %(hostname)s g=E9pen." <- mo= dified > = > And if I have a server with 'ond.vein.hu' hostname, the text will be: > "levelez=E9si list=E1k az ond.vein.hu g=E9pen." > And in case of 'listserv.vein.hu': > "levelez=E9si list=E1k a listserv.vein.hu g=E9pen." > = > Every translator have to define those letters that goes to the group of= > vowels, and the consonant. > = > And finally, I have started translating the README.*,FAQ and INSTALL > files. How should I give name for the translated files? > 1. README.hu, FAQ.hu, a.s.o., or > 2. OLVASSEL (this is the Hungarian word for README) By now I recommend to be README.hu, but must be Barry the one to decide it. -- = ___ / F \ [[[]]]] ( O O ) #----------------0000--(_)--0000---------------# | Juan Carlos Rey Anaya (jcrey@uma.es) | | Servicio Central de inform=E1tica | | Universidad de M=E1laga - Espa=F1a | #----------------------------------------------# From tkikuchi@is.kochi-u.ac.jp Fri May 4 03:14:32 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Fri, 04 May 2001 11:14:32 +0900 Subject: [Mailman-i18n] i18n needs more patch References: <3AEE6F65.D8F56B49@is.kochi-u.ac.jp> <3AEFB8B2.5E0D9BD4@is.kochi-u.ac.jp> Message-ID: <3AF21088.3519E7D9@is.kochi-u.ac.jp> Tokio Kikuchi wrote: > > Hi! > > Mailman/Cgi/handle_opts.py does not translate! > apply this patch. > > Tokio Thins were not so easy. I uploaded a new patch to 2.1a2 at http://sourceforge.net/tracker/index.php?func=detail&aid=420396&group_id=103&atid=300103 From dachinetwanadoo.fr@wanadoo.fr Tue May 8 06:01:50 2001 From: dachinetwanadoo.fr@wanadoo.fr (Dominique) Date: Tue, 8 May 2001 07:01:50 +0200 Subject: [Mailman-i18n] please write in french! Message-ID: <005101c0d77c$046ad280$0a00000a@fti2p27t44fti> D> i find you very interting but i dont no understanding correctly D> your content: send me please the french translation Please ask on mailman-i18n@python.org From barry@digicool.com Wed May 16 23:00:13 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Wed, 16 May 2001 18:00:13 -0400 Subject: [Mailman-i18n] i18n needs more patch References: <3AEE6F65.D8F56B49@is.kochi-u.ac.jp> Message-ID: <15106.63597.40958.409905@anthem.wooz.org> >>>>> "TK" == Tokio Kikuchi writes: TK> I was working on Japanese translation of i18n mailman catalog TK> and found some sentenses are impossible to be translated TK> because they are splitted in small pieces. I submitted a TK> critical patch to sourceforge and would be happy if you can TK> integrate into next alpha release. Thanks very much! I have finally integrated these patches into the CVS tree. -Barry From barry@digicool.com Wed May 16 23:19:50 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Wed, 16 May 2001 18:19:50 -0400 Subject: [Mailman-i18n] Japanese characters in Mailman archive References: <3A13AB56.9B5EEE6@media.osaka-cu.ac.jp> <3A13AFC1.5AA6661A@is.kochi-u.ac.jp> Message-ID: <15106.64774.392573.283052@anthem.wooz.org> >>>>> "TK" == Tokio Kikuchi writes: TK> Please visit Japanized Mailman Page at TK> http://mm.tkikuchi.net/ TK> You must also check the mail archive to check patches. TK> http://mm.tkikuchi.net/pipermail/mmjp-users/ I'm starting to fill in some documentation for i18n Mailman. Can I include links to both of these resources for Japanese users? Thanks, -Barry From tkikuchi@is.kochi-u.ac.jp Thu May 17 03:01:30 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Thu, 17 May 2001 11:01:30 +0900 Subject: [Mailman-i18n] Japanese characters in Mailman archive References: <3A13AB56.9B5EEE6@media.osaka-cu.ac.jp> <3A13AFC1.5AA6661A@is.kochi-u.ac.jp> <15106.64774.392573.283052@anthem.wooz.org> Message-ID: <3B0330FA.90F2E1EA@is.kochi-u.ac.jp> "Barry A. Warsaw" wrote: > > >>>>> "TK" == Tokio Kikuchi writes: > > TK> Please visit Japanized Mailman Page at > TK> http://mm.tkikuchi.net/ > TK> You must also check the mail archive to check patches. > TK> http://mm.tkikuchi.net/pipermail/mmjp-users/ > > I'm starting to fill in some documentation for i18n Mailman. Can I > include links to both of these resources for Japanese users? Yes, please. It would be useful to have a japanese discussion forum even if our Japanization is finally integrated into i18n-Mailman. Many thanks to this great software development team! Tokio Kikuchi From barry@digicool.com Thu May 17 03:42:59 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Wed, 16 May 2001 22:42:59 -0400 Subject: [Mailman-i18n] Japanese characters in Mailman archive References: <3A13AB56.9B5EEE6@media.osaka-cu.ac.jp> <3A13AFC1.5AA6661A@is.kochi-u.ac.jp> <15106.64774.392573.283052@anthem.wooz.org> <3B0330FA.90F2E1EA@is.kochi-u.ac.jp> Message-ID: <15107.15027.309587.957769@anthem.wooz.org> >>>>> "TK" == Tokio Kikuchi writes: TK> Yes, please. It would be useful to have a japanese discussion TK> forum even if our Japanization is finally integrated into TK> i18n-Mailman. I agree. I've added an i18n link to the main Mailman pages (only available through CVS at the moment). I've only got an entry for Japanese resources at the moment, but I envision adding additional pointers for other languages, so... If anybody has specific links you'd like me to add for your language, please send them to me. TK> Many thanks to this great software development team! You're very welcome! -Barry From barry@digicool.com Thu May 17 04:22:35 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Wed, 16 May 2001 23:22:35 -0400 Subject: [Mailman-i18n] Final i18n integration Message-ID: <15107.17403.110839.594261@anthem.wooz.org> I'm hoping to release a new alpha of Mailman 2.1 some time this week, and I would love to finalize the integration of the i18n stuff. Below are my current thoughts on the CVS and distribution structures necessary to accomplish this. Please comment! To CVS: - Each supported language can be checked into the Mailman CVS tree as follows (for mythical language `xx'): templates/xx/*.{html,txt} -- these are translated versions of the English templates messages/xx/README.xx -- a README file containing useful information for anybody wanting to use or modify this translation. It should include at a minimum the necessary entry for LC_DESCRIPTIONS. It might also contain an email address to contact the xx language's champion or leader. messages/xx/LC_MESSAGES/catalog.xx mailman.mo -- these are the human readable translation of the mailman.pot file, and the binary .mo file - There will also be a messages/mailman.pot file checked. I will update that file via pygettext.py when I've piled up enough changes to the translatable strings. Distribution - Mailman will come with a default `en' language containing the original template files, but with no mailman.mo file. - Mailman will have a `light' distribution which contains only the English translations. It might also be worthwhile to distribute a `sumo' package which contains all the checked-in languages. - Each language will be separately distributed as a tarball such that you can run the following in your install directory: % tar zxf mailman-i18n-xx.tgz % bin/newlang -l mylist xx and now language xx will be available to your users (after changing mm_cfg.py of course). - Thus, if we have 10 languages checked in, but you're only interested in 3 of them, you can download the light distro and then install only the language packs that you want. I will definitely be looking for volunteers to manage the language distributions, especially because I expect language updates to happen asychronously from Mailman versions. I think it will be too much work for me to keep the languages up-to-date, shepherd the various translation efforts, do all the language check-ins etc. I'm willing to give a few volunteers check-in privs to the Mailman tree if they are willing to manage the language releases. I'll try to write scripts to make packaging language distros fairly easy. Have I missed anything? I'm going to spend a bit of time putting the basics together before I commit stuff to CVS. If anybody has fairly up-to-date translations of both the templates and the catalog, please send me a link. -Barry From barry@digicool.com Fri May 18 04:22:00 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Thu, 17 May 2001 23:22:00 -0400 Subject: [Mailman-i18n] Re: Tiny help References: <20010502090733.B3904@freemail.hu> <3AEFCB1A.C520A159@uma.es> Message-ID: <15108.38232.541072.646759@anthem.wooz.org> >>>>> "JCRA" == Juan Carlos Rey Anaya writes: >> I am updating the hungarian catalog, but there are some >> problems. The first is: The commandline programs do not use >> right now the translation, although I inserted the >> DEFAULT_SERVER_LANGUAGE='hu' in the mm_cgf.py file. I want to >> see the hungarian messages in the commandline programs, what >> should I do? JCRA> I have discovered why, you must set explicitly language to JCRA> translate into. JCRA> test in bin/version.py: | import paths | import Mailman.mm_cfg | from Mailman.i18n import _, set_language | set_language(Mailman.mm_cfg.DEFAULT_SERVER_LANGUAGE) | print _('Using Mailman version:'), Mailman.mm_cfg.VERSION JCRA> I suppose all scripts in bin must be changed. I think I have a solution for this, which is to essentially set the language when i18n is imported for the first time. For the scripts, this will set the language based on the environment variables as described here: http://www.python.org/doc/current/lib/node186.html For everything else (email, cgi), the language should be reset based on other context, i.e. the server default language, then the list preferred language, then the user preferred language, as each are discovered. >> - all the commandline programs are writing english messages to >> the stdout - the list archive page is still in english JCRA> Yes, it is a work to be done. I found it very difficult to JCRA> translate, because the process of archive generation :-( You JCRA> can try it ;-) I think that the proper persons to do it are JCRA> mailman managers. More work to do on Pipermail. Ug. ;) JCRA> By now I recommend to be README.hu, but must be Barry the JCRA> one to decide it. Yes, README.hu please! I'm going to do some reorganization on the documentation, either converting the various READMEs to html or (more likely) generating a script to do the conversion a la the FAQ. The more uniformity in filenames and writing styles, the better! -Barry From barry@digicool.com Fri May 18 19:28:40 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Fri, 18 May 2001 14:28:40 -0400 Subject: [Mailman-i18n] Template file lookup Message-ID: <15109.27096.120852.101214@anthem.wooz.org> I'm about to change the search order for templates -- you know, those pesky .html and .txt files that live in $prefix/templates and $prefix/lists/$mylist. This change is necessary to properly support language templates, and also provides a much requested feature, namely that you will only need to specialize templates that you actually want to change, and that you have multiple levels of specialization. Here's how it works. There are 4 levels of template specialization: list-centric, vhost-centric, site-centric, and default, corresponding to the directories $prefix/lists/$listname $prefix/templates/$host_name $prefix/templates/site $prefix/templates Each of these locations is further organized by language subdirectories. So let's say you were looking for the listinfo.html template for list foobar in language es. You'd actually end up searching 12 directories, with of course, the first hit stopping the search. Let's say further that list foobar is in the www.foobar.com virtual domain, and that it's list-preferred language is fr, while the server's default language is en. Here's the files you'd search for: $prefix/lists/foobar/es/listinfo.html $prefix/templates/www.foobar.com/es/listinfo.html $prefix/templates/site/es/listinfo.html $prefix/templates/es/listinfo.html $prefix/lists/foobar/fr/listinfo.html $prefix/templates/www.foobar.com/fr/listinfo.html $prefix/templates/site/fr/listinfo.html $prefix/templates/fr/listinfo.html $prefix/lists/foobar/en/listinfo.html $prefix/templates/www.foobar.com/en/listinfo.html $prefix/templates/site/en/listinfo.html $prefix/templates/en/listinfo.html Note that the Mailman 2.0.x search directories of $prefix/lists/*.{html,txt} and $prefix/templates/*.{html,txt} are deprecated and no longer searched. The bin/upgrade script will actually md5 checksum all the old files and remove any templates in more-specific locations that exactly match their more-general counterparts. Any template in $prefix/lists or $templates will have to be moved manually. It is highly discouraged that you will ever manually edit a file in $prefix/templates/$lang, and Mailman's install target will have every right to overwrite them on an upgrade. That's what the templates/site subdirectory is for; upgrading will never touch site-centric, domain-centric, or list-centric templates. Of course, that means it's up to site administrators to merge in changes to the default templates. Watch for checkins shortly. Comments? -Barry From bakyh@etri.re.kr Sat May 19 06:32:13 2001 From: bakyh@etri.re.kr (bakyh@etri.re.kr) Date: Sat, 19 May 2001 14:32:13 +0900 Subject: [Mailman-i18n] =?euc-kr?B?W8D8w7zIuL3FXSBbTWFpbG1hbi1pMThuXSBjYW4ndCBkZWNvZGUg?= =?euc-kr?B?aW4gd2ViIHVzaW5nIG1haWxtYW4u?= Message-ID: <766FA1FC5C2AD511B3C800D0B7A8AC4A1BFD1F@cms3.etri.re.kr> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C0E025.0ED6E4F0 Content-Type: text/plain; charset="euc-kr" I'm a korean. I installed a mailman to Linux 2.2.18. I succeed in sending and receiving msg, but in web failed. In web, I can't read msg in Korean. How can I do it? I think, its reason is that in web browser can't decoding that msg. Shoud I patch about it? What is the patch program and where I can get it? Please, help me. Bak, Yuhyeon. ------_=_NextPart_001_01C0E025.0ED6E4F0 Content-Type: text/html; charset="euc-kr" Content-Transfer-Encoding: quoted-printable [=C0=FC=C3=BC=C8=B8=BD=C5] [Mailman-i18n] can't decode in web = using mailman.

I'm a korean.

I installed a mailman to Linux 2.2.18.

I succeed in sending and receiving msg, but in web = failed.

In web, I can't read msg in Korean.

How can I do it?

I think, its reason is that in web browser can't = decoding that msg.

Shoud I patch about it?

What is the patch program and where I can get = it?
 

Please, help me.

 

Bak, Yuhyeon.

 

------_=_NextPart_001_01C0E025.0ED6E4F0-- From tkikuchi@is.kochi-u.ac.jp Sat May 19 14:53:39 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Sat, 19 May 2001 22:53:39 +0900 Subject: [Mailman-i18n] sorting pygettext.py output Message-ID: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> Hi, I found it a bit hard task to follow up the versions of mailman-i18n because pygettext.py output is random order. Following patch and executing the script with `--style sort' option make the output more friendly for translaters, I believe. Cheers, Tokio Kikuchi --- pygettext.py.orig Sat May 19 22:36:57 2001 +++ pygettext.py Sat May 19 22:40:43 2001 @@ -100,6 +100,7 @@ Solaris # File: filename, line: line-number GNU #: filename:line + sort (slightly modified GNU with filename/line order) The style name is case insensitive. GNU style is the default. @@ -288,7 +289,27 @@ # The time stamp in the header doesn't have the same format # as that generated by xgettext... print pot_header % {'time': timestamp, 'version': __version__} - for k, v in self.__messages.items(): + if options.locationstyle == options.SORT: + messages = {} + for k, v in self.__messages.items(): + file_line = [] + i = 0 + for filename, lineno in v: + file_line[i:] = ['#: %s:%05d\n'% (filename,lineno)] + i = i + 1 + file_line.sort() + s = '' + for f in file_line: + s = s + f + messages[s] = k + x = messages.keys() + x.sort() + for s in x: + print s, + print 'msgid', normalize(messages[s]) + print 'msgstr ""\n' + else: + for k, v in self.__messages.items(): if not options.writelocations: pass # location comments are different b/w Solaris and GNU: @@ -336,6 +357,7 @@ # constants GNU = 1 SOLARIS = 2 + SORT = 3 # defaults extractall = 0 # FIXME: currently this option has no effect at all. escape = 0 @@ -351,6 +373,7 @@ options = Options() locations = {'gnu' : options.GNU, 'solaris' : options.SOLARIS, + 'sort' : options.SORT, } # parse options From tkikuchi@is.kochi-u.ac.jp Sat May 19 15:10:06 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Sat, 19 May 2001 23:10:06 +0900 Subject: [Mailman-i18n] can't decode in web using mailman. References: <766FA1FC5C2AD511B3C800D0B7A8AC4A1BFD1F@cms3.etri.re.kr> Message-ID: <3B067EBE.D6E830EC@is.kochi-u.ac.jp> > bakyh@etri.re.kr wrote: > > I'm a korean. > > I installed a mailman to Linux 2.2.18. > > I succeed in sending and receiving msg, but in web failed. > > In web, I can't read msg in Korean. Hi, I am a japanese. What is the default charset for Korean language. If the charset is other than EUC-KR, then the double-byte code may contain special characters like <,>,&. Japanese mail message is encoded with ISO-2022-JP while the Web pages and internal language data are best treated in EUC-JP. I made short scripts to convert the messages between ISO-2022-JP and EUC-JP and put them in Mailman/Handlers. You may want to browse the scripts, to_euc.py and to_jis.py, which are included in Japanese Mailman at http://mm.tkikuchi.net/mailman-2.0.5+J1.20010514.tar.gz Please check Mailman/Handlers/HandlerAPI.py how to invoke them. Regards, Tokio Kikuchi From jeb@ocha.net Sun May 20 06:36:27 2001 From: jeb@ocha.net (Jeb Bateman) Date: Sat, 19 May 2001 22:36:27 -0700 Subject: [Mailman-i18n] Re: [Mailman-Developers] Template file lookup In-Reply-To: <15109.27096.120852.101214@anthem.wooz.org>; from barry@digicool.com on Fri, May 18, 2001 at 02:28:40PM -0400 References: <15109.27096.120852.101214@anthem.wooz.org> Message-ID: <20010519223627.A3526@ocha.net> On Fri, May 18, 2001 at 02:28:40PM -0400, Barry A. Warsaw wrote: > ...and also provides a much requested feature, namely that you will > only need to specialize templates that you actually want to change, > and that you have multiple levels of specialization. > > Here's how it works. > > There are 4 levels of template specialization: list-centric, > vhost-centric, site-centric, and default, corresponding to the > directories > > $prefix/lists/$listname > $prefix/templates/$host_name > $prefix/templates/site > $prefix/templates This is great, I think, since I've hacked the copy of Mailman I'm using similarly to the patch on sourceforge to enable list-specific templates, (but it was a fragile fix at best without mlist being passed to the template merge function). Anyway, I'm glad to see this is being done right, although I seem to remember seeing a comment by someone recently about the 2.1 alpha Mailman assuming that every directory under $prefix/lists/$listname being a language directory for templates, which caused problems with something, and I remember thinking there might be other reasons I'd want more directories for other purposes under a list directory. So, I'd suggest moving all list templates into a 'templates' subdirectory of the list. Ie, the first search is: $prefix/lists/$listname/templates/ This would keep the list directory uncluttered, and also eliminate code ambiguity about putting other directories under the list dir. Also, one other feature I've been thinking about is to make the web interface for editing templates include a pop-up menu of all templates that affect a list, (searching up the hierarchy for each). Then, when the admin chooses to edit one, it is saved in the $listname/templates directory. Therefore, there is no need to install the current 4 list specific templates in the list templates directory to begin with, and list admins are free to modify any templates affecting their list. Hoping that made sense, -jeb -- Jeb Bateman BuyOrganic.org project - http://buyorganic.org From tkikuchi@is.kochi-u.ac.jp Sun May 20 06:40:26 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Sun, 20 May 2001 14:40:26 +0900 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> Message-ID: <3B0758CA.F4875FA7@is.kochi-u.ac.jp> Tokio Kikuchi wrote: > > Hi, > > I found it a bit hard task to follow up the versions of mailman-i18n > because pygettext.py output is random order. > Following patch and executing the script with `--style sort' option > make the output more friendly for translaters, I believe. Stupid me! Yesterday version throws away one or more msgid's when in a same line, keeping only one msgid. Here is a revised one. Tokio --- pygettext.py.orig Sat May 19 22:36:57 2001 +++ pygettext.py Sun May 20 14:23:10 2001 @@ -100,6 +100,7 @@ Solaris # File: filename, line: line-number GNU #: filename:line + sort (slightly modified GNU with filename/line order) The style name is case insensitive. GNU style is the default. @@ -139,6 +140,7 @@ import time import getopt import tokenize +import re __version__ = '1.1' @@ -288,7 +290,28 @@ # The time stamp in the header doesn't have the same format # as that generated by xgettext... print pot_header % {'time': timestamp, 'version': __version__} - for k, v in self.__messages.items(): + if options.locationstyle == options.SORT: + separator = '#%= ' + x = [] + for k, v in self.__messages.items(): + file_line = [] + for filename, lineno in v: + file_line.append('#: %s:%05d\n'% (filename,lineno)) + file_line.sort() + s = '' + for f in file_line: + s = s + f + s = s + separator + k + x.append(s) + x.sort() + sep = re.compile(separator) + for s in x: + r, k = sep.split(s) + print r, + print 'msgid', normalize(k) + print 'msgstr ""\n' + else: + for k, v in self.__messages.items(): if not options.writelocations: pass # location comments are different b/w Solaris and GNU: @@ -336,6 +359,7 @@ # constants GNU = 1 SOLARIS = 2 + SORT = 3 # defaults extractall = 0 # FIXME: currently this option has no effect at all. escape = 0 @@ -351,6 +375,7 @@ options = Options() locations = {'gnu' : options.GNU, 'solaris' : options.SOLARIS, + 'sort' : options.SORT, } # parse options From loewis@informatik.hu-berlin.de Sun May 20 18:16:50 2001 From: loewis@informatik.hu-berlin.de (Martin von Loewis) Date: Sun, 20 May 2001 19:16:50 +0200 (MEST) Subject: [Mailman-i18n] sorting pygettext.py output In-Reply-To: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> (message from Tokio Kikuchi on Sat, 19 May 2001 22:53:39 +0900) References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> Message-ID: <200105201716.TAA07056@pandora.informatik.hu-berlin.de> > I found it a bit hard task to follow up the versions of mailman-i18n > because pygettext.py output is random order. > Following patch and executing the script with `--style sort' option > make the output more friendly for translaters, I believe. This is a very good idea. I think pygettext should always sort the output, without even asking the user; ideally in the same way as xgettext would sort them. It appears that your patch sorts them by file-then-line, so does xgettext. Therefore, I propose that you remove the command line option, and submit your change to sf.net/projects/python. Thanks for contributing, Martin From barry@digicool.com Mon May 21 03:15:10 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Sun, 20 May 2001 22:15:10 -0400 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> Message-ID: <15112.31278.344279.369036@anthem.wooz.org> >>>>> "MvL" == Martin von Loewis writes: MvL> This is a very good idea. I think pygettext should always MvL> sort the output, without even asking the user; ideally in the MvL> same way as xgettext would sort them. It appears that your MvL> patch sorts them by file-then-line, so does xgettext. MvL> Therefore, I propose that you remove the command line option, MvL> and submit your change to sf.net/projects/python. Sounds like a good idea. Feel free to assign your patch to me and I'll take it from there. -Barry From barry@digicool.com Mon May 21 20:32:18 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Mon, 21 May 2001 15:32:18 -0400 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> Message-ID: <15113.27970.761588.120053@yyz.digicool.com> >>>>> "MvL" == Martin von Loewis writes: >> I found it a bit hard task to follow up the versions of >> mailman-i18n because pygettext.py output is random order. >> Following patch and executing the script with `--style sort' >> option make the output more friendly for translaters, I >> believe. MvL> This is a very good idea. I think pygettext should always MvL> sort the output, without even asking the user; ideally in the MvL> same way as xgettext would sort them. It appears that your MvL> patch sorts them by file-then-line, so does xgettext. MvL> Therefore, I propose that you remove the command line option, MvL> and submit your change to sf.net/projects/python. I'm about to check in a slightly different patch, which retains packed GNU style comments and also fixes a bug that can cause duplicate entries. Details (including the patch) are available at http://sourceforge.net/tracker/index.php?func=detail&aid=425821&group_id=5470&atid=305470 Thanks! -Barry From tkikuchi@is.kochi-u.ac.jp Wed May 23 00:56:01 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Wed, 23 May 2001 08:56:01 +0900 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> Message-ID: <3B0AFC91.16064756@is.kochi-u.ac.jp> "Barry A. Warsaw" wrote: > > I'm about to check in a slightly different patch, which retains packed > GNU style comments and also fixes a bug that can cause duplicate > entries. Details (including the patch) are available at > > http://sourceforge.net/tracker/index.php?func=detail&aid=425821&group_id=5470&atid=305470 > Barry, There was a misunderstanding. Your patch sort the filename/lineno descriptions within each item of translatables. My patch sorts all the entries of them. May be it is because my initial post put the option within `--style' category and none of your fault. pygettext.py with my patch outputs like this > > #: bin/add_members:00216 > msgid "( blank line )" > msgstr "" > > #: bin/add_members:00218 > msgid "Not a valid email address:" > msgstr "" > > #: bin/arch:00073 > msgid "listname is required" > msgstr "" > > #: bin/arch:00091 > #: bin/change_pw:00100 > #: bin/config_list:00101 > #: bin/config_list:00192 > #: bin/newlang:00084 > #: bin/rmlang:00095 > msgid "" > "No such list \"%(listname)s\"\n" > "%(e)s" > msgstr "" With this output, we can find where to make new translations easily when the version ups. I hope you can integrate this idea into your patch. Thank you, Tokio From barry@digicool.com Wed May 23 17:33:47 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Wed, 23 May 2001 12:33:47 -0400 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> Message-ID: <15115.58987.611071.270379@anthem.wooz.org> >>>>> "TK" == Tokio Kikuchi writes: TK> There was a misunderstanding. Your patch sort the TK> filename/lineno descriptions within each item of TK> translatables. My patch sorts all the entries of them. May be TK> it is because my initial post put the option within `--style' TK> category and none of your fault. No, I think I just didn't look close enough at your patch, but I see now what it's doing. Okay, so now I've got another patch to pygettext.py which first sorts the locations in each individual entry (by filename then lineno), and then sorts the catalog entries by the tuples of location. So you end up with entries like the attached, taken from the head of mailman.pot. If that looks good, I'll check it in. -Barry -------------------- snip snip -------------------- #. docstring #: Mailman/Archiver/Archiver.py:18 msgid "" "Mixin class for putting new messages in the right place for archival.\n" "\n" "Public archives are separated from private ones. An external archival\n" "mechanism (eg, pipermail) should be pointed to the right places, to do the\n" "archival.\n" msgstr "" #: Mailman/Archiver/Archiver.py:123 msgid "List traffic archival policies." msgstr "" #: Mailman/Archiver/Archiver.py:125 Mailman/Autoresponder.py:64 #: Mailman/Autoresponder.py:81 Mailman/Bouncer.py:67 Mailman/Digester.py:55 #: Mailman/Digester.py:71 Mailman/Digester.py:93 Mailman/Digester.py:98 #: Mailman/GatewayManager.py:53 Mailman/GatewayManager.py:57 #: Mailman/GatewayManager.py:61 Mailman/MailList.py:511 #: Mailman/MailList.py:521 Mailman/MailList.py:546 Mailman/MailList.py:550 #: Mailman/MailList.py:557 Mailman/MailList.py:567 Mailman/MailList.py:572 #: Mailman/MailList.py:666 Mailman/MailList.py:680 Mailman/MailList.py:691 #: Mailman/MailList.py:694 Mailman/MailList.py:726 Mailman/MailList.py:800 #: Mailman/MailList.py:808 msgid "No" msgstr "" #: Mailman/Archiver/Archiver.py:125 Mailman/Autoresponder.py:64 #: Mailman/Bouncer.py:67 Mailman/Digester.py:55 Mailman/Digester.py:71 #: Mailman/Digester.py:93 Mailman/Digester.py:98 Mailman/GatewayManager.py:53 #: Mailman/GatewayManager.py:57 Mailman/GatewayManager.py:61 #: Mailman/MailList.py:511 Mailman/MailList.py:521 Mailman/MailList.py:546 #: Mailman/MailList.py:550 Mailman/MailList.py:557 Mailman/MailList.py:567 #: Mailman/MailList.py:572 Mailman/MailList.py:666 Mailman/MailList.py:680 #: Mailman/MailList.py:691 Mailman/MailList.py:694 Mailman/MailList.py:726 #: Mailman/MailList.py:800 Mailman/MailList.py:808 msgid "Yes" msgstr "" #: Mailman/Archiver/Archiver.py:126 msgid "Archive messages?" msgstr "" #: Mailman/Archiver/Archiver.py:128 msgid "public" msgstr "" From tkikuchi@is.kochi-u.ac.jp Thu May 24 03:51:00 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Thu, 24 May 2001 11:51:00 +0900 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> Message-ID: <3B0C7714.C31CF035@is.kochi-u.ac.jp> "Barry A. Warsaw" wrote: > > Okay, so now I've got another patch to pygettext.py which first sorts > the locations in each individual entry (by filename then lineno), and > then sorts the catalog entries by the tuples of location. So you end > up with entries like the attached, taken from the head of > mailman.pot. > > If that looks good, I'll check it in. It is exactly what I want. Thank you very much, Barry! Tokio From barry@digicool.com Thu May 24 04:03:59 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Wed, 23 May 2001 23:03:59 -0400 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> <3B0C7714.C31CF035@is.kochi-u.ac.jp> Message-ID: <15116.31263.58847.917240@anthem.wooz.org> >>>>> "TK" == Tokio Kikuchi writes: TK> It is exactly what I want. Thank you very much, Barry! Cool! I thought it might be so I've already checked it into the Python tree (and will soon copy it over to the Mailman tree). -Barry From tkikuchi@is.kochi-u.ac.jp Thu May 24 06:10:35 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Thu, 24 May 2001 14:10:35 +0900 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> <3B0C7714.C31CF035@is.kochi-u.ac.jp> <15116.31263.58847.917240@anthem.wooz.org> Message-ID: <3B0C97CB.16DA7AD0@is.kochi-u.ac.jp> "Barry A. Warsaw" wrote: > > >>>>> "TK" == Tokio Kikuchi writes: > > TK> It is exactly what I want. Thank you very much, Barry! > > Cool! I thought it might be so I've already checked it into the > Python tree (and will soon copy it over to the Mailman tree). > Ouch! You have just followed my fault. Here is output from new pygettext.py #: ./Mailman/Cgi/admin.py:750 msgid "member address
member name" msgstr "" #: ./Mailman/Cgi/admin.py:751 msgid "hide" msgstr "" #: ./Mailman/Cgi/admin.py:752 msgid "not metoo" msgstr "" , whereas admin.py reads usertable.AddRow([Center(h) for h in (_('member address
member name'), _('subscr'), _('hide'), _('nomail'), _('ack'), _('not metoo'), _('digest'), _('plain'), _('language'))]) Only one entry per line was kept in the output. sorry, but it must be fixed. Tokio From loewis@informatik.hu-berlin.de Thu May 24 15:07:03 2001 From: loewis@informatik.hu-berlin.de (Martin von Loewis) Date: Thu, 24 May 2001 16:07:03 +0200 (MEST) Subject: [Mailman-i18n] sorting pygettext.py output In-Reply-To: <15115.58987.611071.270379@anthem.wooz.org> (barry@digicool.com) References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> Message-ID: <200105241407.QAA15270@pandora.informatik.hu-berlin.de> > If that looks good, I'll check it in. That is indeed what sorting should do, IMO. While sorting and normalization certainly helps when a new version of the catalog comes along, there is actually tool for merging an old localized catalog with the new POT file, in the form of GNU msgmerge. I don't know whether you are all aware of it, so I thought I'd mention it. Is anybody interested in having a pure-python version of msgmerge, or is using GNU msgmerge good enough? Regards, Martin From barry@digicool.com Fri May 25 00:04:33 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Thu, 24 May 2001 19:04:33 -0400 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> <3B0C7714.C31CF035@is.kochi-u.ac.jp> <15116.31263.58847.917240@anthem.wooz.org> <3B0C97CB.16DA7AD0@is.kochi-u.ac.jp> Message-ID: <15117.37761.632897.826001@anthem.wooz.org> >>>>> "TK" == Tokio Kikuchi writes: TK> Ouch! You have just followed my fault. Here is output from TK> new pygettext.py Darn, you're right. Okay, I've now got a new version which aggressively sorts the entries. :) E.g. -------------------- snip snip -------------------- #: Mailman/Cgi/admin.py:729 msgid "member address
member name" msgstr "" #: Mailman/Cgi/admin.py:730 msgid "hide" msgstr "" #: Mailman/Cgi/admin.py:730 msgid "nomail" msgstr "" #: Mailman/Cgi/admin.py:730 msgid "subscr" msgstr "" #: Mailman/Cgi/admin.py:731 msgid "ack" msgstr "" #: Mailman/Cgi/admin.py:731 msgid "not metoo" msgstr "" -------------------- snip snip -------------------- To be checked into both Python and Mailman momentarily... -Barry From barry@digicool.com Fri May 25 00:12:06 2001 From: barry@digicool.com (Barry A. Warsaw) Date: Thu, 24 May 2001 19:12:06 -0400 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> <200105241407.QAA15270@pandora.informatik.hu-berlin.de> Message-ID: <15117.38214.631296.820799@anthem.wooz.org> >>>>> "MvL" == Martin von Loewis writes: MvL> While sorting and normalization certainly helps when a new MvL> version of the catalog comes along, there is actually tool MvL> for merging an old localized catalog with the new POT file, MvL> in the form of GNU msgmerge. I don't know whether you are MvL> all aware of it, so I thought I'd mention it. Definitely! In fact the "make catalogs" target in Mailman's messages/Makefile invokes msgmerge to merge any new definitions found in mailman.pot with the individual language .po files. (I hope I understand the usage properly. It looks good to me but others may want to double check.) MvL> Is anybody interested in having a pure-python version of MvL> msgmerge, or is using GNU msgmerge good enough? GNU's msgmerge seems fine to me. Mailman's Makefile is also using the default msgfmt, although I know you contributed one for Python's Tools/i18n directory. If you've got a msgmerge laying around, I think it would make a good addition to Tools/i18n, but it isn't as urgent as pygettext (which was required because the standard GNU tool, xgettext, just didn't grok Python code well enough). -Barry From tkikuchi@is.kochi-u.ac.jp Mon May 28 12:10:25 2001 From: tkikuchi@is.kochi-u.ac.jp (Tokio Kikuchi) Date: Mon, 28 May 2001 20:10:25 +0900 Subject: [Mailman-i18n] sorting pygettext.py output References: <3B067AE3.CFD1934F@is.kochi-u.ac.jp> <200105201716.TAA07056@pandora.informatik.hu-berlin.de> <15113.27970.761588.120053@yyz.digicool.com> <3B0AFC91.16064756@is.kochi-u.ac.jp> <15115.58987.611071.270379@anthem.wooz.org> <200105241407.QAA15270@pandora.informatik.hu-berlin.de> Message-ID: <3B123221.9810998D@is.kochi-u.ac.jp> Martin, Barry, Thank you both for all the help for easier handling of language catalogs. I haven't tried msgmerge before but I now know its power. Martin von Loewis wrote: > > > If that looks good, I'll check it in. > > That is indeed what sorting should do, IMO. I really needed this feature because human language is very much dependent of context that I must frequently refer the original code. > > While sorting and normalization certainly helps when a new version of > the catalog comes along, there is actually tool for merging an old > localized catalog with the new POT file, in the form of GNU msgmerge. > I don't know whether you are all aware of it, so I thought I'd mention > it. Yes, and it tells me the changed string with "#, fussy" mark. Great! And, I put up my Japanese translations of POT and templates at http://mm.tkikuchi.net/mailman-2.1alpha.ja/ These will be updated frequently but I will be happy if you can include them in the next alpha release. Many thanks, Tokio