[PyQt] Re: Internationalization and PyQt

Giovanni Bajo rasky at develer.com
Sun Oct 5 18:24:17 BST 2008


On dom, 2008-10-05 at 18:19 +0200, Thorsten Kampe wrote:
> * Giovanni Bajo (Sun, 05 Oct 2008 12:46:15 +0200)
> > On sab, 2008-10-04 at 20:31 +0200, Thorsten Kampe wrote:
> > > So why does my code (that does not query the locale and choose the
> > > right tranlation file according to the locale) work?
> > 
> > Why it should not? QTranslator.load() takes care of embedding the
> > locale name into the filename by itself (see the documentation).
> 
> Okay, I read the documentation to QTranslator.load(). It does actually 
> nothing of what you claim. To the contrary: it /strips/ the locale name 
> from the file name (if it can't find it). It appends the /suffix/ (.qm) 
> which again has nothing to do with what I asked.

Sorry, I stand corrected.

Anyway, it looks like your code works equally well because you demand to
the Qt Resource system to choose the right file based on the current
locale. It might well be that Mark's example didn't use the same trick
(maybe his resources weren't using the same aliased name but the raw
filenames).

Does this answer your question?
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com




More information about the PyQt mailing list