KLocalizedString regression

Thiago Macieira thiago at kde.org
Fri Mar 25 14:20:35 GMT 2011


Em sexta-feira, 25 de março de 2011, às 13:59:11, John Tapsell escreveu:
> > Well, yes. Two grammar-wise different text fragments (enumerable vs.
> > measurable quantities) are being used in alternation, so each should be
> > represented by its own string. The author of KUnitConversion wanted the
> > same feature, so there too we ended up defining two strings, e.g:
> > 
> >      setDefaultUnit(UP(Meter, 1,
> >        ...
> >        ki18nc("amount in units (real)", "%1 meters"),
> >        ki18ncp("amount in units (integer)", "%1 meter", "%1 meters")
> >      ));
> 
> Except that in my case, I'm forcing this on the users of my API.  Just
> to get around this!
> 
> Can't you see how crazy this is?

No. You haven't said anything about your API yet.

Maybe the problem is in the API. But we don't know, because you haven't 
included a link to what API you're talking about.

> > In my opinion, however, this alternation is bad style-wise. The display
> > should use either the measurable form throughout (2.0 seconds; 2.2e4
> > seconds), or the enumerable form throughout (2 seconds; 6 hours 6
> > minutes).
> 
> But what if I want to allow both?  This is for labelling the axis of a
> graph.  I now have to have an API and forces the users to give the
> same string twice.

Huh? Why do you want to show "1.0 seconds" in the axis? Shouldn't you have 
"1.0" in the axis and then "seconds" in the axis label?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110325/927330a4/attachment.sig>


More information about the kde-core-devel mailing list