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

List:       kde-i18n-doc
Subject:    Re: Strange/wrong plural forms in kcoreaddons5_qt
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2018-01-24 23:04:38
Message-ID: 1621916.fQ9gZUsqft () xps
[Download RAW message or body]

El dimecres, 24 de gener de 2018, a les 20:58:56 CET, Karl Ove Hufthammer va 
escriure:
> In kcoreaddons5_qt.pot there are some strange (relatively new) strings:
> 
>    %n millisecond(s)
>    %n day(s)
>    %n hour(s)
>    %n minute(s)
>    %n second(s)
> 
> The strange thing is that they're plural form strings, but both the
> singular and the plural version are identical, e.g. ‘%n hour(s)'. I
> would expect them to be English singular and plural, e.g. ‘%n hour' for
> the singular case and ‘%n hours' for the plural case. How are we
> supposed to translate them? The normal way?
> 
> The same file also contains a set of similar, older strings *without*
> plural forms, e.g. ‘%1 days' (note the ‘%1' instead of ‘%n').
> 
> Now it happens that for my language (Norwegian Nynorsk), the older
> strings are translated, while the new strings are not. So the newer
> strings are shown in English. This means that I can easily observe how
> the ‘%1' and ‘%n' strings work in practice. And it doesn't look right to me.
> 
> They seem to be used in the details view of the file copying
> notification (e.g., they might show ‘1 minute and 56 seconds
> remaining'). To see them in action, try to copy some large files (to a
> slow disk) and open the details view.
> 
> The strange thing is that the older strings seems to be used when the
> number shown is 1 and the newer strings are used when it is > 1. Here's
> an example. To simplify things, let's pretend that minutes is called
> ‘minuto' and seconds ‘sekundo' in my language. The countdown when
> copying files would look something like this:
> 
> 3 minute(s) and 2 second(s) remaindos
> 3 minute(s) and 1 sekundo remaindos
> 3 minute(s) remaindos
> …
> 2 minute(s) and 3 second(s) remaindos
> 2 minute(s) and 2 second(s) remaindos
> 2 minute(s) and 1 sekundo remaindos
> 2 minute(s) remaindos
> …
> 1 minuto and 3 second(s) remaindos
> 1 minuto and 2 second(s) remaindos
> 1 minuto and 1 sekundo remaindos
> …
> 
> This seems wrong. Firstly, having ‘minute(s)' in English looks bad (as I
> translator I guess I shouldn't care too much, but it's a shame for
> people who use the English UI). 

The english translation has the correct form, see en/messages/frameworks/
kcoreaddons5_qt.po

#. @item:intext %1 is a whole number
#: lib/util/kformatprivate.cpp:288
#, qt-format
msgctxt "KFormat|"
msgid "%n millisecond(s)"
msgid_plural "%n millisecond(s)"
msgstr[0] "%n millisecond"
msgstr[1] "%n milliseconds"

And given that we always load the english translation you shouldn't be seeing 
that "2 minute(s) and 2 second(s) remaindos" at all, which Qt and KF5 versions 
are you using?

> And why should *different* strings be
> used for the number 1 and for other numbers? The expected behaviour
> would be to use *different plural* forms of the same string.

There is no different string used for singular and plural, there is just one
https://cgit.kde.org/kcoreaddons.git/tree/src/lib/util/kformatprivate.cpp#n298

Cheers,
  Albert
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic