[Panel-devel] getThemePath broken in SK

Matt matt-lists at comnet.net.nz
Tue Jun 7 10:30:53 CEST 2005


On Tue, 07 Jun 2005 18:39, Petri Damsten wrote:
> > Is it possible to embed i18n() calls into our text functions such as
> > createText()? That way translations are handled inside SuperKaramba
> > instead of by the theme writers.
>
> .theme file translation should be handled automatically in superkaramba.
> Python is a different story. e.g. following line doesn't work if it's
> translated in superkaramba.
> karamba.changeText(widget, txt, '%d Apples' % 2)
>
> I would use existing python functions for this. Here is example of a theme
> that translates texts to Finnish. Translations are included in skz file.
> http://susku.pyhaselka.fi/damu/sk/i18n.skz
>
> So the code looks like:
> karamba.changeText(widget, txt, _('%d Apples') % 2)
>
> Benefits:
> - This is the way people have used to do translations in python.
> - Existing tested GNU gettext / python implementation.
> - Translations can be made with existing tools like xgettext, KBabel.
>
> TODO:
> - karamba_helpers.py module that gets installed to python path and includes
> functions to initialize translation, dcop, etc... (Not a necessity)
> - translation of .theme texts
>
> For python only themes this already works and for .theme files
> modifications to superkaramba are small and could be implemented (by me)
> pretty quickly. Could this be the preferred way to do i18n in superkaramba
> themes?
>
> Petri

wow.  Why do you need to use the getThemeText().  Will createText() work as
well?  Also, why a two step process?  Why can't we put the _('%d Apples') % 2
bit right into a createText() line?

Also, will this work with utf-8 encoded characters (I am assuming it will
given that it's using i18n).

I'm seriously annoyed that you've got this working and it took me 3
weeks to work out how to do the kludgy translation method that I use :(

How would I go about converting my translation files to i18n based
translations?  Any way I might be able to automate this?

Matt



More information about the Panel-devel mailing list