Monoglotism in TurboGears…

or how the support for localization in Turbo Gears seems to be borked!

I have spent several hours trying to get a very simple Turbo Gears sample application to “speak” a different language, with no success. This is all part of my research at work to localize our rPath Appliance Agent to other idioms.

The rPath Appliance Agent (rAA) is a framework for administering appliances built with rPath technologies through a web based user interface. Including rAA with an appliance enables a central point of control for administration, configuration, and maintenance functions, such as logging and email notifications, user account preferences, and software updates.

rAA uses among other things Turbo Gears under the hood, and for my “experiment” I started a fairly simple project by running:

tg-admin quickstart mytest

and accepted the defaults by hitting enter at every prompt. I then proceeded to modify the default welcome.kid template by removing the standard “you got Turbo Gears to run, hurray hurray” stuff and simplied it to:


Hello World!

Now, after bumping my head against the wall a couple of times, I learned (the hard way, off course) that the command line is not your best friend for generating po files right now. Instead, I opened a separate console and started the toolbox kit with:

tg-admin toolbox -n

and pointed my browser to http://localhost:7654. From there, I chose the admin18n option and was presented a pretty simple and concise explanation of how to localize your Turbo Gears applications… or so it looked. I clicked through the options for generating the po, adding a language (pt_BR and pt), translating the only string (offline, using vim), and compiling the “language module.” The one thing I noticed right away was that even though the pt_BR folder and po was created, it would not be displayed as an available language. Heck, it wasn’t even available in the dropdown list! :P

Anyhow, I finished the experiment by adding “i18n.run_template_filter = True” and “session_filter.on = True” to my dev.cfg file, and even added a “turbogears.i18n.set_session_locale(‘pt_BR’)” to my controler.py to force the language to Brazilian Portuguese, but nothing! No matter what I do, my page will always display Hello World! in english only!
Does anyone have a clue???


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

5 Responses to “Monoglotism in TurboGears…”

  1. I finally gave up on turbo gears. I honestly tried to use it. Instead, in every respect, I’ve had much more success with Django than tg. I’ll admit though, I’ve never used translation. I only know english so still haven’t learned how to use i18n stuff.

  2. I have to agree with Matthew Nuzum. For the blogs, portal softwares and other content orientated stuff is django really the best framework out. You can easily mix it with any other template system without the need of plugins and it really rocks :D

    And if you want to develop something that you want to deploy (eg: a web application) i recommend paste in combination with sqlalchemy and a template engine :)

    Regards,
    Armin

  3. I tried getting i18n/l10n to work with Turbogears as well, no success either.
    Well, actually I had partial success: when using _(“Some string”) in the actual code, it worked, but not for strings contained in the template itself.

    I’m now looking into Java Server Faces / Facelets. They also have an XML syntax, and probably perform much better, too.

    In my tests, Turbogears performance was really reall bad.

  4. [...] disappearance from the interwebs was followed by pleas for his return, about 9 months ago (you can find his last post here if you really want to). I used to love reading [...]

  5. [...] disappearance from the interwebs was followed by pleas for his return, about 9 months ago (you can find his last post here if you really want to). I used to love reading [...]

Leave a Reply

CAPTCHA Image CAPTCHA Audio
Refresh Image