[PyQt] Re: Internationalization problem

Andreas Pakulat apaku at gmx.de
Sat Oct 20 09:38:08 BST 2007


On 20.10.07 03:13:08, Thorsten Kampe wrote:
> * Andreas Pakulat (Sat, 20 Oct 2007 00:40:04 +0200)
> > On 19.10.07 21:47:58, Thorsten Kampe wrote:
> > > reading through Mark Summerfield's book I've tried to localise my 
> > > appliation. This works fine for my own translation but not for the one 
> > > >from Trolltech (qt_de.qm). This means that for instance all my menus 
> > > are in German but the close, maximize, minimize and restore buttons in 
> > > the upper right edge are still in English.
> > 
> > The window-buttons are usually provided by the windowing system and thus
> > are not translated by the application itself.
> 
> I know but I thought if a translation exists then this should take 
> priority.

As I tried to explain: The text of the buttons in the titlebar of your
application are _not_ part of your application. They're part of the
windowing/desktop system and thus are translated by that desktop systems
translation mechanism (most frameworks use gettext for translation
purposes on linux, not Qt's custom stuff). So the only thing you can get
translated is the actual title of your application. That one however
is of course not part of the Qt translations but the ones of your app.

> > Have you checked wether a QFileDialog provides proper translated text?
> 
> It's actually Q3TitleBar (the context as seen in Qt Linguist)

That class is part of the Qt3 dockwidget code, i.e. this only affects
the close/minimize buttons on Qt3 dockwidgets. The Qt4 QDockWidget class
doesn't use this (private) Qt3-Support class

Andreas

-- 
You will give someone a piece of your mind, which you can ill afford.


More information about the PyQt mailing list