TurboGears 1.1 + Kid + i18n

6 views
Skip to first unread message

Daniel Haus

unread,
Oct 12, 2009, 8:36:26 AM10/12/09
to TurboGears
Hello all!

After moving one of my applications to TurboGears 1.1 to make it run
on Python 2.6 (somehow 1.0 didn't work) I have a problem with i18n
now. The applications still uses kid, so I checked that the config has
the at least following settings:

tg.defaultview = "kid"
session_filter.on = True
i18n.run_template_filter = True
i18n.default_locale = "en"

The compiled translations are in the appropriate places (i18n message
extraction & compilation vie the toolbox seems to work fine) and calls
to tg.i18n.get_locale() inside my templates delivers the correct
value. Still, the static strings inside of my kid-templates won't be
translated at all.

What could be the problem here? Maybe I'm just missing a configuration
option? Or is there a change (maybe regarding to the move to Genshi in
1.1) I have overseen, that needs special attention? What else could I
check?

Thank you!
Daniel

Christopher Arndt

unread,
Oct 12, 2009, 10:47:27 AM10/12/09
to turbo...@googlegroups.com
Daniel Haus schrieb:

> After moving one of my applications to TurboGears 1.1 to make it run
> on Python 2.6 (somehow 1.0 didn't work)

Yes, Python .26 is only supported by TG 1.1.

> I have a problem with i18n now. The applications still uses kid, so
> I checked that the config has the at least following settings:

> Still, the static strings inside of my kid-templates won't be
> translated at all.

I just checked this. It seems that the new template engine option
loading introduced an unintended change, which breaks i18n for kid, if
you configure it according to the documentation.

> tg.defaultview = "kid"
> session_filter.on = True
> i18n.run_template_filter = True
> i18n.default_locale = "en"

For now, you need to add

kid.i18n.run_template_filter = True

to your configuration as well, and things should work again. We will fix
this in the next 1.1 release [1] so that the old way of configuring
things works again.

Chris


[1] http://trac.turbogears.org/ticket/2392

Daniel Haus

unread,
Oct 12, 2009, 11:07:08 AM10/12/09
to TurboGears
Thanks a lot, Christopher!

Christopher Arndt

unread,
Oct 12, 2009, 1:41:59 PM10/12/09
to turbo...@googlegroups.com
Christopher Arndt schrieb:

> For now, you need to add
>
> kid.i18n.run_template_filter = True
>
> to your configuration as well, and things should work again. We will fix
> this in the next 1.1 release [1] so that the old way of configuring
> things works again.
>
> [1] http://trac.turbogears.org/ticket/2392

This is fixed in SVN r6872 now. kid.i18n.run_template_filter now
defaults to True if i18n.run_template_filter is enabled and Kid is
available.

I.e. you can still turn off the translation filter for Kid templates
only, if you set i18n.run_template_filter to True and
kid.i18n.run_template_filter to False in your configuration.


Chris

Reply all
Reply to author
Forward
0 new messages