D14940: kformattest: Use plural suffix (s) consequently

2018-08-26 Thread Albert Astals Cid
aacid added a comment.


  In D14940#315172 , @habacker wrote:
  
  > 
https://forum.wordreference.com/threads/decimals-plural-singular.2054431/#post-10279600
 listed many public organisations that are using signular for values between 1 
and -1.
  
  
  At this point, does it really matter though? Qt doesn't support what you want 
to do, so you need to convince them not us.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-25 Thread Ralf Habacker
habacker added a comment.


  
https://forum.wordreference.com/threads/decimals-plural-singular.2054431/#post-10279600
 listed many public organisations that are using signular for values between 1 
and -1.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-24 Thread Nathaniel Graham
ngraham added a comment.


  FWIW, "1.0 seconds" is what I've always been taught.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-23 Thread Albert Astals Cid
aacid added a comment.


  In D14940#313853 , @habacker wrote:
  
  > I see - Qt lacks support for choosing the correct translation string for 
floating point values like this:
  >
  >   qreal value = 1.0;
  >tr("%n second(s)", nullptr, value).
  >
  > which should return **1.0 second**
  
  
  Are you sure about that? Most answer i find online say 1.0 seconds is the 
right way to write it, basically, because if you write 1.0 seconds is because 
you know it's not 1 second, but something that rounds to 1.0 seconds, i.e in 
the 0.96 to 1.04 range with a precision of one digit.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-23 Thread Ralf Habacker
habacker added a comment.


  I see - Qt lacks support for choosing the correct translation string for 
floating point values like this:
  
qreal value = 1.0;
tr("%n second(s)", nullptr, value).
  
  which should return **1.0 second**
  
qreal value = 1.34;
tr("%n second(s)", nullptr, value).
  
  which should return **1.34 seconds**
  
qreal value = 0.0;
tr("%n second(s)", nullptr, value).
  
  which should return **0.0 seconds**
  
  and for strings:
  
int decimalPlaces = 2;
qreal MSecsInSecond = 1000;
qreal msecs = 1000.0
return tr("%n second(s)").arg(m_locale.toString(msecs / (MSecsInSecond * 
1.0), 'f', decimalPlaces));
  
  which should return **1.00 second**
  
int decimalPlaces = 2;
qreal MSecsInSecond = 1000;
qreal msecs = 1100.0
return tr("%n second(s)").arg(m_locale.toString(msecs / (MSecsInSecond * 
1.0), 'f', decimalPlaces));
  
  which should return **1.10 seconds**

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-22 Thread Albert Astals Cid
aacid added a comment.


  In D14940#313136 , @habacker wrote:
  
  > According to the section'Handling of plurals' on 
http://doc.qt.io/qt-5/i18n-source-translation.html, for plurals an '(s)' is 
used instead of the 's' as suffx. You are refering to a different  spec ?
  
  
  Yes, that is for plurals, not for decimals.
  
  1.3 days is not a plural in the sense described there[1], it's a decimal 
number and it follows different rules.
  
  [1] see how n is an integer not a float

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-22 Thread Ralf Habacker
habacker added a comment.


  According to the section'Handling of plurals' on 
http://doc.qt.io/qt-5/i18n-source-translation.html, for plurals an '(s)' is 
used instead of the 's' as suffx. You are refering to a different  spec ?

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-21 Thread Albert Astals Cid
aacid requested changes to this revision.
aacid added a comment.
This revision now requires changes to proceed.


  This is not how plurals for decimals work, they are always in plural.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D14940

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-20 Thread Ralf Habacker
habacker updated this revision to Diff 40038.
habacker added a comment.


  - type fix in KFormatTest::formatDecimalDuration
  - missing plural fix in KFormatPrivate::formatDecimalDuration

REPOSITORY
  R244 KCoreAddons

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14940?vs=40027=40038

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D14940

AFFECTED FILES
  autotests/kformattest.cpp
  src/lib/util/kformatprivate.cpp

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14940: kformattest: Use plural suffix (s) consequently

2018-08-20 Thread Ralf Habacker
habacker created this revision.
habacker added a reviewer: aacid.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
habacker requested review of this revision.

REVISION SUMMARY
  Mixing plural '(s)' and translated 's' suffix could not be correct.

REPOSITORY
  R244 KCoreAddons

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D14940

AFFECTED FILES
  autotests/kformattest.cpp

To: habacker, aacid
Cc: kde-frameworks-devel, michaelh, ngraham, bruns