[PATCH] Do not show fractional numbers for duration in transfer dialog

Chusslove Illich caslav.ilic at gmx.net
Tue Jul 1 23:37:33 BST 2008

> [: Aurélien Gâteau :]
> Attached patch removes fractional parts after the minutes and seconds.
> There is a problem because the code does not use i18ncp, showing "1
> minutes remaining". But at least it should not harm too much for seconds
> ("1 seconds remaining" is not likely to stay visible for too long...)

There are two points here.

The original code didn't use plural call because it was displaying a real
number (two decimals), which is consider to have, hm, "collective" nature,
and thus no plural forms. But, when you reduce it to no decimals, on user's
side it become an integer, and should have plural forms.

"1 seconds remaining" will be wrong grammar for a brief time only in 1,>1
plural languages (such as English, French, German...) For many other
languages it will be bad grammar much more of the time, e.g. about 30-40%
for Slavic languages (e.g. they use 1-form for any number that *ends* in 1).

So, if you do want to proceed -- which I would, looks nicer when integer --
then you should use i18np call, and instead of formatted number-string
really send in an integer-type argument (because plural is decided by
integer arguments).

> I could also rework the code a bit more deeper and display durations as "1
> minute 23 seconds", but this would of course break string freeze.

Since the dialog is very visible, I wouldn't mind freeze break to have it
nice like that (you can count this as approval from one translation team :)

Just make sure that you compose this string, to allow plural for both:

  QString mins = i18np("1 minute", "%1 minutes", ...);
  QString secs = i18np("1 second", "%1 seconds", ...);
  QString rtime = mins + ' ' + secs;

(strictly speaking, someone might object the last line, but let's wait if
that actually happens...)

Chusslove Illich (Часлав Илић)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080702/a043cad9/attachment.sig>

More information about the kde-core-devel mailing list