Re: [Mailman-Developers] i18n imports
![](https://secure.gravatar.com/avatar/0f6659cffae7268f27fe318a4f1a42d0.jpg?s=120&d=mm&r=g)
At 04:15 PM 2/16/01 -0500, I wrote:
Jeez, Barry, that itty-bitty change you made last night to not import _ into the namespace by default broke a *lot* of things...
I was trying to use config_list, and had to edit several modules to do a from Mailman.i18n import _... Add Bouncer.py to that.
W.r.t my newlang problems..
Since I deleted the templates/en dir I had created to test the fallback, newlang wouldn't work, because there's no en directory to copy to the new list... It needs to catch the fact that ok_langs is empty before the loop that prints which languages were installed runs, otherwise the status message looks stupid :-).
Perhaps instead of saying "language not supported" it say "No template directory for language." Particularly since that's the only check; it doesn't matter if the language is defined or not in Defaults, and, in fact, if it's NOT defined there, you can still install support for it with newlang, you just can't tell mailman to use it later. (Which means, come to think of it, that in a perfect world newlang would check the supported languages array out of Defaults as well as looking for the directory...)
Newlang also has a nasty habit of leaving the list locked if anything goes wrong.
w.r.t your comment about needing to look at the call to HTMLFormatter. You do need to init it, because mlist._template_path is used by it, and by newlang, and it's *not* defined in MailList; HTMLFormatter adds it to the object when it runs. The reason it's broken, however, which came to me in a blinding flash of "duh", is that we instantiate an mlist for the list we're looking at, but do the initvars on "list", not "mlist"... So on newlang line 86 change list to mlist.
BTW, there's going to be either a very smart update procedure needed, or a lot of verbiage in the Readme... Or both. People need to install EN support into each list they own. Which they can do by hand, or with newlang. However, if newlang does it, it'll populate the files from the template directory. Now, because all lists default to en, they'll be using *those* templates, which might differ from the one that are installed in the list. (Which, is, of course, a regular occupational hazard of updating mailman, but there's a new twist.) So those templates, which haven't been changed by anyone, won't be used anymore, without admins being any the wiser unless they pay attention.
Two things need to happen in an upgrade, order optional. Each list needs an "en" subdir, and all the templates in the list dir need to move to the en dir. Also, all the templates, as usual, need to be checked by hand against the new versions. (Luckily, so far, the only difference between any of mine, and the defaults is the revision number in the comment.)
If everyone was running an english version, I'd say just have update move *.html, installing a new headfoot.html, since that seems to be new, into an en dir for each list, then print the standard warning to go compare configurations. Anyone that's already done any language changes though will find their local language sitting in the english subdir... Either way, there's copius notage in the readme necessary to explain where things are going and why...
![](https://secure.gravatar.com/avatar/cb6b2a19d7ea20358a4c4f0332afc3ef.jpg?s=120&d=mm&r=g)
"RJ" == Ron Jarrell <jarrell@vt.edu> writes:
RJ> Since I deleted the templates/en dir I had created to test the
RJ> fallback, newlang wouldn't work, because there's no en
RJ> directory to copy to the new list... It needs to catch the
RJ> fact that ok_langs is empty before the loop that prints which
RJ> languages were installed runs, otherwise the status message
RJ> looks stupid :-).
Okay, I've fixed those in my working copy.
RJ> Perhaps instead of saying "language not supported" it say "No
RJ> template directory for language."
Good point, I've made that change.
RJ> Newlang also has a nasty habit of leaving the list locked if
RJ> anything goes wrong.
Arg! Okay, I've added the necessary armor to it and rmlang (although I'm not sure the list needs to be locked for rmlang).
RJ> w.r.t your comment about needing to look at the call to
RJ> HTMLFormatter. You do need to init it, because
RJ> mlist._template_path is used by it, and by newlang, and it's
RJ> *not* defined in MailList; HTMLFormatter adds it to the object
RJ> when it runs.
I'm not sure why _template_dir is a temporary attribute (i.e. starts with an _ so it doesn't persist). Seems to me the proper fix is to either make _template_dir a permanent attribute, or simply access it via a method and calculate it on the fly. Actually, in light of the below, that might be the right thing.
RJ> People need to install EN support into each list they own.
RJ> Which they can do by hand, or with newlang.
RJ> Anyone that's already done any language changes though will
RJ> find their local language sitting in the english
RJ> subdir... Either way, there's copius notage in the readme
RJ> necessary to explain where things are going and why...
We have to make it so that if a MM2.0 user upgrades and never cares about multilingual support, things Just Keep Working without anything more they explicitly need to do.
This means either our upgrade script sets things up minimally, or we make sure everything falls back to the existing templates if en is never installed. Your second point implies then that if they've made their own language mods to those templates, that language will be the default (and the list config will look a bit strange when it says that they're using English as the default language).
Any opinions? Do we need to create the en subdir upon upgrade or can we use any existing templates as a fallback?
-Barry
![](https://secure.gravatar.com/avatar/0f6659cffae7268f27fe318a4f1a42d0.jpg?s=120&d=mm&r=g)
At 06:33 PM 2/21/01 -0500, you wrote:
Any opinions? Do we need to create the en subdir upon upgrade or can we use any existing templates as a fallback?
Well, if we install the "en" directory, the other problems won't happen (ref. the other message I posted where I tracked down why GetConfig was blowing up on my older lists; it tries to do an index on a null list, because there are no subdirs on the list). I'm thinking it's cleaner to just force the template files into an en directory. Technically, the current officially supported language is english, so that's not bad. Even if they made their existing files be swahili, they'll still work, they'll just show up as english. People who have been hacking in their own language support probably are smart enough to look at the readme for a comment about adding new languages, or can figure it out...
![](https://secure.gravatar.com/avatar/cb6b2a19d7ea20358a4c4f0332afc3ef.jpg?s=120&d=mm&r=g)
"RJ" == Ron Jarrell <jarrell@vt.edu> writes:
>> Any opinions? Do we need to create the en subdir upon upgrade
>> or can we use any existing templates as a fallback?
RJ> Well, if we install the "en" directory, the other problems
RJ> won't happen (ref. the other message I posted where I tracked
RJ> down why GetConfig was blowing up on my older lists; it tries
RJ> to do an index on a null list, because there are no subdirs on
RJ> the list).
I've got a workaround for that but still, you might be right to just force an `en' subdir on upgrade.
-Barry
![](https://secure.gravatar.com/avatar/3004d1fb90b4a89c5501cf52ae463f12.jpg?s=120&d=mm&r=g)
We are all very excited (well, at least my friends and me are :-) about the i18n features upcoming. Since most of the translations are complete, how can we help? Is it possible to test them? Not only because we cannot wait (as usual) but mainly because it could be useful to add some extra eyes on it.
Sorry if it's a FAQ, I've been on the list only for a while.
-- Alessio F. Bragadini alessio@sevenseas.org
La Citta` Invisibile: notizie e dibattiti per i cittadini della Rete http://www.citinv.it
participants (3)
-
Alessio Bragadini
-
barry@digicool.com
-
Ron Jarrell