Re: [Mailman-Developers] Problems with Vietnamese translation

Clytie Siddall wrote:
I don't know. The mailman.pot does have the spaces between '#:' and the path. msgmerge on my Cygwin test installation actually will put the space in between '#:' and the path even if it isn't there in the original mailman.po file, but if there are different msmerges out there that exhibit different behavior, perhaps bin/po2templ.py needs to be updated to account for differing formats.
In my case, I think the problem could be addressed by reordering messages/Makefile.in to run msgmerge on the mailman.po before po2templ.py and installing the templates, but if there are different msgmerge behaviors, that wouldn't work for everyone. We'd need to update po2templ.py.
It shouldn't be difficult to work up a patch to po2templ.py (using re) that would make it more robust in this area. I'm willing to do that, but I may not have time to get to it for a few days.
The comments in Defaults.py.in say in part
# Vgg: Language descriptions and charsets dictionary, any new supported # language must have a corresponding entry here.
I think this means it's up to the translator to put it there, but I'm not really familiar with Mailman i18n procedures.
If you look at Defaults.py.in in the trunk and in the Release_2_1-maint branch (they're different in this respect) at the very end of the file, it should be obvious what to do.
Is this analagous with adding a language code to the ALL_LINGUAS line
in configure.in or configure.ac ?
No, not really.
configure.in contains commands to build ALL_LINGUAS by listing the messages directory and selecting all subdirectory names of form '..' and '.._..'.
The entries in Defaults.py are the same language codes, but they contain the 'name' of the language (e.g., _(Vietnamese)), and the name of the character set for the language.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro wrote:
Here's a patch --- MM-Trunk/mailman/bin/po2templ.py 2006-04-18 18:06:32.484375000 -0700 +++ test-mailman-trunk/bin/po2templ.py 2006-04-26 19:42:24.843750000 -0700 @@ -27,8 +27,11 @@ Usage: po2templ.py languages """ +import re import sys +cre = re.compile('^#:[ ]*templates/en/(?P<filename>.*):1') + ? def do_lang(lang): @@ -38,10 +41,11 @@ fp = file('messages/%s/LC_MESSAGES/mailman.po' % lang) try: for line in fp: - if line.startswith('#: templates'): + m = re.search(cre, line) + if m: in_template = True in_msg = False - filename = line[16:-3] + filename = m.group('filename') outfilename = 'templates/%s/%s' % (lang, filename) continue if in_template and line.startswith('#,'): I tested this and it seems to work fine whether or not mailman.po has a space after the '#:'. Tokio, Do you think we should go ahead and commit this on the trunk? -- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Hi Mark,
Thanks for this patch. I've committed this on the trunk slightly differently, though.
Cheers,
-- Tokio Kikuchi, tkikuchi@ is.kochi-u.ac.jp http://weather.is.kochi-u.ac.jp/

On Wed, 2006-04-26 at 08:16 -0700, Mark Sapiro wrote:
Just for the record, it's fine for the translator to add an entry here for their language. Often though, new languages are donated by people who don't have commit privileges, so it should technically be done by whoever does the initial commit of the language.
-Barry

Mark Sapiro wrote:
Here's a patch --- MM-Trunk/mailman/bin/po2templ.py 2006-04-18 18:06:32.484375000 -0700 +++ test-mailman-trunk/bin/po2templ.py 2006-04-26 19:42:24.843750000 -0700 @@ -27,8 +27,11 @@ Usage: po2templ.py languages """ +import re import sys +cre = re.compile('^#:[ ]*templates/en/(?P<filename>.*):1') + ? def do_lang(lang): @@ -38,10 +41,11 @@ fp = file('messages/%s/LC_MESSAGES/mailman.po' % lang) try: for line in fp: - if line.startswith('#: templates'): + m = re.search(cre, line) + if m: in_template = True in_msg = False - filename = line[16:-3] + filename = m.group('filename') outfilename = 'templates/%s/%s' % (lang, filename) continue if in_template and line.startswith('#,'): I tested this and it seems to work fine whether or not mailman.po has a space after the '#:'. Tokio, Do you think we should go ahead and commit this on the trunk? -- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Hi Mark,
Thanks for this patch. I've committed this on the trunk slightly differently, though.
Cheers,
-- Tokio Kikuchi, tkikuchi@ is.kochi-u.ac.jp http://weather.is.kochi-u.ac.jp/

On Wed, 2006-04-26 at 08:16 -0700, Mark Sapiro wrote:
Just for the record, it's fine for the translator to add an entry here for their language. Often though, new languages are donated by people who don't have commit privileges, so it should technically be done by whoever does the initial commit of the language.
-Barry
participants (3)
-
Barry Warsaw
-
Mark Sapiro
-
Tokio Kikuchi