[PythonCAD] Internationalization of pythoncad with gettext

Art Haas ahaas at airmail.net
Tue Mar 21 15:56:37 CET 2006

On Sun, Mar 19, 2006 at 03:21:21PM -0500, patrick.hetu wrote:
> Hi Art and everyone,
> I'm using pythoncad and i think it could touch more people if menus and
> instructions are in there own language. 
> Do you think its a good idea to include Internationalization module like
> gettext?

An i18n version of PythonCAD would be wonderful! As you write above, the
program would be more appealing to many people if the menus and prompts
were in their native language.

> I try to include it to the code for giving you a patch but I'm really
> not sure where i must put the function and how call it and i don't know
> how the installation of the .mo file could be include in the setup
> module.
I'm not sure how to handle '.mo' files in the 'setup.py' file either,
but that hasn't been a problem as there were no '.mo' files to deal
with. Adding the hooks into the code is a matter of using the 'gettext'
module that is shipped with Python - see the docs for more info. As for
the PythonCAD code, the text to be translated gets adjusted like so:

s = 'blah blah blah' ==> s = _('blah blah blah')

This change is simply wrapping the string in a function call _().

> I talk french and I'm pretty sure that i can translate almost every
> message in my language and even the web site if you want to.

I would welcome patches to make PythonCAD have French text. As for the
website, it needs a major overhaul as it looks just too "texty".

Art Haas

Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

More information about the PythonCAD mailing list