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

Enhanced plural forms for languages with complex rules

This commit is contained in:
Muhammad Fawwaz Orabi 2013-10-10 10:36:01 +02:00 committed by nowrep
parent cb0cd31f3b
commit c2ed0d6482
3 changed files with 68 additions and 18 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") + QLatin1String(" ") + tr("seconds", "", time.second());
return tr("%n seconds", "", time.second());
}
else if (time < QTime(1, 0)) {
return time.toString("m") + QLatin1String(" ") + tr("minutes", "", time.minute());
return tr("%n minutes", "", time.minute());
}
else {
return time.toString("h") + QLatin1String(" ") + tr("hours", "", time.hour());
return tr("%n hours", "", time.hour());
}
}

View File

@ -288,19 +288,18 @@ QString QzTools::fileSizeToString(qint64 size)
double _size = size / 1024.0; // KB
if (_size < 1000) {
return QString::number(_size > 1 ? _size : 1, 'f', 0) + " KB";
return QString::number(_size > 1 ? _size : 1, 'f', 0) + " " + QObject::tr("KB");
}
_size /= 1024; // MB
if (_size < 1000) {
return QString::number(_size, 'f', 1) + " MB";
return QString::number(_size, 'f', 1) + " " + QObject::tr("MB");
}
_size /= 1024; // GB
return QString::number(_size, 'f', 2) + " GB";
return QString::number(_size, 'f', 2) + " " + QObject::tr("GB");
}
QPixmap QzTools::createPixmapForSite(const QIcon &icon, const QString &title, const QString &url)
{
const QFontMetrics fontMetrics = QApplication::fontMetrics();

View File

@ -1579,26 +1579,62 @@ Please install latest version of QupZilla.</source>
<source>few seconds</source>
<translation>بضع ثوانٍ</translation>
</message>
<message>
<message numerus="yes">
<location filename="../src/lib/downloads/downloaditem.cpp" line="258"/>
<source>seconds</source>
<translation>ثا</translation>
<source>%n seconds</source>
<translation>
<numerusform>ثانية</numerusform>
<numerusform>ثانية واحدة</numerusform>
<numerusform>ثانيتان</numerusform>
<numerusform>%n ثوانٍ</numerusform>
<numerusform>%n ثانيةً</numerusform>
<numerusform>%n ثانيةٍ</numerusform>
</translation>
</message>
<message>
<message numerus="yes">
<location filename="../src/lib/downloads/downloaditem.cpp" line="261"/>
<source>minutes</source>
<translation>د</translation>
<source>%n minutes</source>
<translation>
<numerusform>دقيقة</numerusform>
<numerusform>دقيقة واحدة</numerusform>
<numerusform>دقيقتان</numerusform>
<numerusform>%n دقائق</numerusform>
<numerusform>%n دقيقةً</numerusform>
<numerusform>%n دقيقةٍ</numerusform>
</translation>
</message>
<message>
<message numerus="yes">
<location filename="../src/lib/downloads/downloaditem.cpp" line="264"/>
<source>hours</source>
<translation>سا</translation>
<source>%n hours</source>
<translation>
<numerusform>ساعة</numerusform>
<numerusform>ساعة واحدة</numerusform>
<numerusform>ساعتان</numerusform>
<numerusform>%n ساعات</numerusform>
<numerusform>%n ساعةً</numerusform>
<numerusform>%n ساعةٍ</numerusform>
</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="271"/>
<source>Unknown speed</source>
<translation>لا تُعرف السرعة</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="276"/>
<source>kB/s</source>
<translation>ك.ب/ثا</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="281"/>
<source>MB/s</source>
<translation>م.ب/ثا</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="285"/>
<source>GB/s</source>
<translation>ج.ب/ثا</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="309"/>
<source>Unknown size</source>
@ -1612,7 +1648,7 @@ Please install latest version of QupZilla.</source>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="313"/>
<source>Remaining %1 - %2 of %3 (%4)</source>
<translation>تبقى %1 - %2 من %3 (%4)</translation>
<translation>تبقت %1 - %2 من %3 (%4)</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloaditem.cpp" line="344"/>
@ -1700,7 +1736,7 @@ Please install latest version of QupZilla.</source>
<message>
<location filename="../src/lib/downloads/downloadmanager.cpp" line="176"/>
<source>%1% of %2 files (%3) %4 remaining</source>
<translation>%1% من %2 (%3) - تبقى %4</translation>
<translation>%1% من %2 (%3) - تبقت %4</translation>
</message>
<message>
<location filename="../src/lib/downloads/downloadmanager.cpp" line="179"/>
@ -3824,6 +3860,21 @@ Please install latest version of QupZilla.</source>
<source>Unknown size</source>
<translation>لا يُعرف الحجم</translation>
</message>
<message>
<location filename="../src/lib/tools/qztools.cpp" line="291"/>
<source>KB</source>
<translation>كيلوبايت</translation>
</message>
<message>
<location filename="../src/lib/tools/qztools.cpp" line="296"/>
<source>MB</source>
<translation>ميغابايت</translation>
</message>
<message>
<location filename="../src/lib/tools/qztools.cpp" line="300"/>
<source>GB</source>
<translation>جيجابايت</translation>
</message>
<message>
<location filename="../src/lib/tools/qztools.cpp" line="619"/>
<source>Executable: </source>