About libconversion

Petri Damstén petri.damsten at gmail.com
Tue Apr 7 09:20:21 CEST 2009


On Tuesday 07 April 2009 00:23:46 Albert Astals Cid wrote:
> A Dilluns, 6 d'abril de 2009, Albert Astals Cid va escriure:
> > Hi, this is more than anything targetted at Petri Damstén but Marco
> > suggesting mailing the list so here i am.
> >
> > There's a bug handling i18n in libconversion in that you have
> >
> > Unit(QObject* parent, const QString& singular, const QString& plural,
> > const QString& symbol, double multiplier,
> > const QStringList& synonyms = QStringList());
> >
> > That's wrong as it assumes just singular and plural, but can't handle
> > languages with more than two plurals like Gaelic that has 5.
> >
> > You should be really using a KLocalizedString (probably through ki18ncp)
> > and using KLocalizedString::subs on it to get the correct results for all
> > languages and numbers of the unit.
>
> Hmm people from IRC made me realize that maybe that Unit class is not used
> for creating things like messages "2 meters" but for recognizing messages
> entered by the user that are "2 meters".
>
> Sorry maybe i jumped to the conclusion too fast, what's it used for?

Problem is that currently it is used for both things like this:
- All singular, plural, symbol and synonyms are used for matching user entered 
string. 
- Result string is constructed using singular and plural
- singular is also used for filling combobox choices (unit converter applet)

Petri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090407/3550113c/attachment.sig 


More information about the Plasma-devel mailing list