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

List:       kde-devel
Subject:    Re: i18n questions
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2003-01-28 19:03:38
[Download RAW message or body]

On Tuesday 28 January 2003 19:14, Oswald Buddenhagen wrote:
> On Tue, Jan 28, 2003 at 02:30:52PM +0100, Nicolas Goutte wrote:
> > QString CSSProperty;
> > if (result==i18n("bolder"))
> > 	CSSProperty="bolder";
> > else if (result==i18n("bold"))
> > 	CSSProperty="bold";
> > // and so on
>
> // ... 2 hours and 50 kb code later ...

This CSS poperty has only a few values. So I thought that a table was too much 
for an example.

>
> holy moly ...
>
> static const char *keywords[] = { I18N_NOOP("bolder"), ... };
> static const int nkeywords = sizeof(keywords)/sizeof(keywords[0]);
> if (<current language is english)
>   listbox->insertStrList(keywords, nkeywords);
> else
>   for (i = 0; i < nkeywords; i ++)
>     listbox->insert(i18n("%1 (%2)", "keyword (description)")

Sorry but that is wrong! The context comes before, not after!

It should be:
	listbox->insert(i18n("keyword (description)","%1 (%2)")

>         .arg(keywords[i]).i18n(keywords[i]));
> <build second table from .desktop file(s)>

I do not understand that. Why a second table?

>
> dialog->exec(); yada yada yada ...
>
> int cit = listbox->currentItem();
> if (cit == -1) // yes, this can happen unless you make sure it does not
>   return;
> if (cit >= nkeywords)
>   CSSProperty = secondTable[cit - nkeywords];
> else
>   CSSProperty = keywords[cit];
>
>
> or something like that ...
>
> greetings

Have a nice day/evening/night!
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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