On 25 March 2011 14:20, Thiago Macieira <thi...@kde.org> wrote: > 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.
I have a widget, KSignalPlotter, which plots data points. The usage is: KSignalPlotter plotter; plotter.setUnit( ki18ncp("Units", "%1 second", "%1 seconds") ); plotter.addBeam(Qt::red); plotter.addSample( QList<qreal>() << 2 ); For example. The axis will then be labelled using the "unit" string. The precision will be calculated automatically. > 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? Because typically we have a lot more horizontal space than vertical space. Adding room for axis labels would take up valuable vertical space. John