1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Added plural forms for hours/mins/secs in download manager and tr() for data units

This commit is contained in:
Muhammad Fawwaz Orabi 2013-09-28 23:01:53 +03:00
parent 00d566fd97
commit baecfddad1
2 changed files with 33 additions and 12 deletions

View File

@ -255,13 +255,13 @@ QString DownloadItem::remaingTimeToString(QTime time)
return tr("few seconds");
}
else if (time < QTime(0, 1)) {
return time.toString("s") + " " + tr("seconds");
return time.toString("s") + " " + tr("seconds", "", time.second());
}
else if (time < QTime(1, 0)) {
return time.toString("m") + " " + tr("minutes");
return time.toString("m") + " " + tr("minutes", "", time.minute());
}
else {
return time.toString("h") + " " + tr("hours");
return time.toString("h") + " " + tr("hours", "", time.hour());
}
}
@ -273,16 +273,16 @@ QString DownloadItem::currentSpeedToString(double speed)
speed /= 1024; // kB
if (speed < 1000) {
return QString::number(speed, 'f', 0) + " kB/s";
return QString::number(speed, 'f', 0) + " " + tr("kB/s");
}
speed /= 1024; //MB
if (speed < 1000) {
return QString::number(speed, 'f', 2) + " MB/s";
return QString::number(speed, 'f', 2) + " " + tr("MB/s");
}
speed /= 1024; //GB
return QString::number(speed, 'f', 2) + " GB/s";
return QString::number(speed, 'f', 2) + " " + tr("GB/s");
}
void DownloadItem::updateDownloadInfo(double currSpeed, qint64 received, qint64 total)

View File

@ -1578,26 +1578,47 @@ Please install latest version of QupZilla.</source>
<source>few seconds</source>
<translation type="unfinished"></translation>
</message>
<message>
<message numerus="yes">
<location filename="../src/lib/downloads/downloaditem.cpp" line="258"/>
<source>seconds</source>
<translation type="unfinished"></translation>
<translation type="unfinished">
<numerusform></numerusform>
</translation>
</message>
<message>
<message numerus="yes">
<location filename="../src/lib/downloads/downloaditem.cpp" line="261"/>
<source>minutes</source>
<translation type="unfinished"></translation>
<translation type="unfinished">
<numerusform></numerusform>
</translation>
</message>
<message>
<message numerus="yes">
<location filename="../src/lib/downloads/downloaditem.cpp" line="264"/>
<source>hours</source>
<translation type="unfinished"></translation>
<translation type="unfinished">
<numerusform></numerusform>
</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="271"/>
<source>Unknown speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="276"/>
<source>kB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="281"/>
<source>MB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="285"/>
<source>GB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="309"/>
<source>Unknown size</source>