Subject: Re: [Thuban-list] Re: translation of thuban

From: "Daniel Calvelo Aros" <[email-masked]>
Date: Tue, 15 Apr 2003 04:47:04 -0500

This is very good news.

Indeed, the infrstructure is already in place. I just finished some
tweaking, and it works splendidly. You will find attached a .po file
with the beginnings of a Spanish translation. It was extracted from the
sources using cygwin's xgettext but I reckon pygettext is OK.

All you have to do is comment out 'def _' in Thuban/__init__.py, erase
every reference to it (there are about a dozen 'from Thuban import _'
all around Lib/ Model/ and UI/) and modify (this is Win32) python.pyw to
include, e.g.

import gettext
gettext.install('Thuban',os.path.join(thubandir,'Locale'))

(after thubandir has been defined, of course)

This assumes you created a Locale dir in the installation dir, with a
Locale/es/LC_MESSAGES/Thuban.mo file.

To produce Thuban.mo, run msgfmt (or msgfmt.py) on the attached es.po
file (and rename it).

The only problem I see is in keeping the .po files current with CVS. We
might gather translators (yes I'm volunteering, for French and Spanish)
around each release and send them merged .po files (gettext has tools to
regenerate the translatable strings and merging them with current
translations). The generation of .mo files should also be integrated in
the build process of the installers.

All this is release 0.2, not CVS, sorry about that.

Daniel.

PS. Could you CC: this to Francisco, please Jan-Oliver?

> Hi,
> 
> [ I am cc'ing this to the Thuban mailing list as it is of
> general interest ]
> 
> On Fri, Apr 11, 2003 at 06:12:21PM -0600, Francisco S G Jáuregui wrote:
> > We are a very small group of people currently involved in the
development 
> > of free GIS tools supported by a government research institution in
Mexico.
> > 
> > We have come across your Thuban project, and have found it very
appealing; 
> > your extensive use of Python has been particularly attractive to us.
> 
> thats nice to hear :-)
> 
> > With your permission we would like to prepare a translation of
Thuban into 
> > Spanish, intended for use in Latin America.  Of course we would also
send 
> > you any bug reports and comments that might pop into our (largely 
> > untrained) minds.
> 
> any translation efford is welcome!
> 
> So far, we only made the first step towards real i18n support
> and that is, we use a special function _() for any strings.
> This function is eventually to be replaced by real gettext
> functionality. Once this second step happened, it will be fairly
> easy to add any translation.
> 
> If you know about gettext functionality and how to use
> it with python, your help would be very welcome to set this up.
> If not, we'll have to see when we can afford the time to
> do this ourselves (we are currently very busy working on further
> projections, PostGIS-support and table management).
> 
> Best
> 
> 	Jan
> -- 
> Jan-Oliver Wagner               http://intevation.de/~jan/
> 
> Intevation GmbH	              	     http://intevation.de/
> FreeGIS	                               http://freegis.org/
> 
> _______________________________________________
> Thuban-list mailing list
> [email-masked]
> https://intevation.de/mailman/listinfo/thuban-list
> 
> 

-- Daniel Calvelo Aros
--
-- Dirección General de Información Agraria
-- Ministerio de Agricultura
-- (51-1) 424-9001

---

From: Jan-Oliver Wagner <[email-masked]>
Date: Tue, 15 Apr 2003 12:15:51 +0200

> To produce Thuban.mo, run msgfmt (or msgfmt.py) on the attached es.po

thanks for your interest and help.
You've motivated us to add the es.po and translation functionality immediately
to the CVS :-)

> the build process of the installers.

It would be great if you could take over the task for spanish and
french. The easiest way to keep the stuff up-to-date is to update
the po-file from the CVS and send us the cvs diff. We can then
easily add the patch.

For new Thuban releases we drop a note on this list so that
the translators can update the po-files to have up-to-date translations
included in the release.

We'll do the german translation. So with spanish, french, german and
english we will have already quite a nice i18n support for Thuban 0.3 :-)

	Jan

---

From: Bernhard Herzog <[email-masked]>
Date: 15 Apr 2003 20:31:07 +0200

> You've motivated us to add the es.po and translation functionality immediately

It wasn't quite immediately, but it's in CVS now.

There's a new subdirectory po/ to hold the translations (currently
there's only Daniel's es.po) plus a Makefile and a README with info
about how to manage the po files.

The handling of the po/mo files is not very well integrated with the
build system at the moment. You have to manually run the Makefile on
some occasions, such as building a thuban.pot from the sources, updating
existing .po files and building the mo files (more info in po/README).

Furthermore, the Makefile only works on Unix-like systems and it needs
gettext 0.11. 0.10.x may work but it will at least give you lots of
warnigns because it doesn't really understand python syntax.

Source distributions (created with setup.py sdist) will have a
thuban.pot file and the mo-files so that building thuban from a source
tarball doesn't require gettext, msgfmt etc. and a unix-environment.

Finally, we've not removed the "from Thuban import _" imports. We
explicitly bind a gettext method to _ in Thuban/__init__.py and do not
use gettext.install. The reason is that Thuban can be used as a library
to build other applications on top of (which we do in GREAT-ER) and a
library should not modify the __builtin__ namespace otherwise it could
interfere with the application which could also want to call
gettext.install.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/