[XML-SIG] Will gettext do?

Uche Ogbuji uche.ogbuji@fourthought.com
Tue, 30 Jan 2001 09:28:47 -0700


OK.  With the rechrge given by Martin, some more digging throught the bowels 
of msgfmt.py and gettext.py, and a lot more hacking at distutils, I think I'm 
ready to declare partial victory.  I have gettext working on my machine.

The reason the victory is only partial is that I can't see how to generalize 
the procedure when more languages are added.

Here is the procedure I follow in distutils, say for 4DOM.

1. run pygettext to create build/[platform]/_xmlplus/4Suite.po
2. run msgfmt to create the build/[platform]/_xmlplus/4Suite.mo
3. create build/[platform]/_xmlplus/en_US/LC_MESSAGES and move 4Suite.mo there
4. Make distutils copy build/[platform]/_xmlplus/en_US/LC_MESSAGES/4Suite.mo 
to the equivalent directory in the Python lib

The problem is step 3.  I can't see a way (and I read all the way through 
msgfmt.py) to automatically mark the locales whose directories I should 
create.  I basically hard-code the creation of "en_US", and I'd have to 
hard-code "de_DE" and all that when I get the translations.

Maybe this is how it's supposed to be, but it seems odd.

I'll troll about a bit more in Tools/i18n/, but I thought maybe Martin or 
someone has the snap answer.

Anyway, if anyone wants to have an early look, I've synced the anonymous CVS 
with my internal version.  You can now check out 4Suite and see the updates. 
setup.py and admin/DistExt.py have the distutils extensions for gettext and 
Dom, Lib, Rdf, and Xslt have changed __init__ and en_US.py -> 
"MessageSource.py".

Also, I've checked in the .po files for interested translators to work on, 
though I'd wait for a bit because I'm about to post a message on gettext 
translation maintenance.

Anonymous CVS procedures here:

http://lists.fourthought.com/pipermail/4suite/2001-January/001165.html


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python