[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdepim/kalarm
From:       David Faure <faure () kde ! org>
Date:       2004-04-10 19:59:44
Message-ID: 200404102159.45073.faure () kde ! org
[Download RAW message or body]

On Saturday 10 April 2004 13:57, Simon Hausmann wrote:
> On Saturday 10 April 2004 13:44, David Jarvie wrote:
> [...]
> > --- kdepim/kalarm/soundpicker.cpp  #1.7:1.8
> > @@ -50,4 +50,6 @@
> >  const QString SoundPicker::i18n_Sound    = i18n("An audio sound", "Sound");
> >  const QString SoundPicker::i18n_s_Sound  = i18n("An audio sound", "&Sound"); 
> 
> This does not work as expected. It'll give you an
> untranslated string, as at initialization time of 
> your global QString objects KGlobal::locale() 
> will returna null pointer and hence i18n will
> return QString::fromUtf8.

And the solution is to use I18N_NOOP2, since you want to provide context.
But I added that macro to klocale.h very recently, and kdepim-cvs-head doesn't want
to require kdelibs-cvs-head, so you should put this in your file:

// In case your kdelibs is < 3.3
#ifndef I18N_NOOP2
#define I18N_NOOP2( comment,x ) x
#endif

... hmm, but in fact in your case you don't really need static 
QStrings containing i18n'ed texts, better just call i18n at runtime.

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic