How to do l10n for dynamic strings in KDE4 ?

Nicolas Goutte nicolasg at snafu.de
Sat Mar 4 14:01:20 GMT 2006


On Saturday 04 March 2006 14:46, Andras Mantia wrote:
> > Am Samstag, 4. März 2006 13:12 schrieb Nicolas Goutte:
> >
> > I knew somhow it could get misunderstood. No, actuallly I dindn't mean
> > Babelfish lookup. ;-)
> > I meant doing i18n() on a dynamic looked up string instead of a const
> > char*, like:
> >
> > i18n( mixercontrol->getName() );        /* vs */        i18n("CD Audio");
>
> You coudl mark the strings to be translated (either by defining dummy
> QStrings like s=i18n("CD Audio"); s=i18n("Master Volume") or by using
> I18N_NOOP) and later use
>

> i18n(mixertcontrol->getName().utf8());
>
> AFAIK it will not work with QString, you have to convert it to a UTF8
> char*.

Ah, yes, sorry, I forgot that subtlety.

>
> Of course, you can put the strings to an XML file as well and update the
> messages target to extract the strings from there for translation.
>
> We do all of the above in Quanta.

Thanks for reminding me where the next example was.

>
> Andras

Have a nice day!





More information about the kde-core-devel mailing list