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

List:       kde-devel
Subject:    Re: i18n questions
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2003-01-28 18:14:42
[Download RAW message or body]

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 ...
> 
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)")
        .arg(keywords[i]).i18n(keywords[i]));
<build second table from .desktop file(s)>

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

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
 
>> 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