Utility: Fix plural translation.

This commit is contained in:
Klaas Freitag 2016-03-18 08:30:32 +01:00
parent 41b43bf961
commit f04895a407

View file

@ -444,7 +444,7 @@ QString Utility::timeAgoInWords(const QDateTime& dt, const QDateTime& from)
if( dt.daysTo(now)>0 ) {
int dtn = dt.daysTo(now);
return QObject::tr("%1 day(s) ago", "", dtn).arg(dtn);
return QObject::tr("%n day(s) ago", "", dtn).arg(dtn);
} else {
qint64 secs = dt.secsTo(now);
if( secs < 0 ) {
@ -452,7 +452,7 @@ QString Utility::timeAgoInWords(const QDateTime& dt, const QDateTime& from)
}
if( floor(secs / 3600.0) > 0 ) {
int hours = floor(secs/3600.0);
return( QObject::tr("%1 hour(s) ago", "", hours).arg(hours));
return( QObject::tr("%n hour(s) ago", "", hours).arg(hours));
} else {
int minutes = qRound(secs/60.0);
if( minutes == 0 ) {
@ -462,7 +462,7 @@ QString Utility::timeAgoInWords(const QDateTime& dt, const QDateTime& from)
return QObject::tr("Less than a minute ago");
}
}
return( QObject::tr("%1 minute(s) ago", "", minutes).arg(minutes));
return( QObject::tr("%n minute(s) ago", "", minutes).arg(minutes));
}
}
return QObject::tr("Some time ago");