summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2015-10-29 11:24:47 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-29 12:17:29 -0700
commit9132390689e89ba589011d4110a3a1f654842cb1 (patch)
tree3237275c97527dd162cdae79a6552c7f7bcd279d /qthelper.cpp
parentf451387f8f2901f312af2b1bdbc6c095c44e27bd (diff)
downloadsubsurface-9132390689e89ba589011d4110a3a1f654842cb1.tar.gz
Fix plurals translation
This allows separate translation of singular and plural forms Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 2f1f0416e..a12d25333 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1074,14 +1074,11 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday)
localTime.setTimeSpec(Qt::UTC);
QString ret ;
- if (nr != 1) {
- if (getday) {
- ret = localTime.date().toString(dateFormat) + " " + QObject::tr("(%1 dives)").arg(nr);
- } else {
- ret = localTime.date().toString("MMM yy") + " " + QObject::tr("(%1 dives)").arg(nr);
- }
+ QString suffix = " " + QObject::tr("(%n dive(s))", "", nr);
+ if (getday) {
+ ret = localTime.date().toString(dateFormat) + suffix;
} else {
- ret = localTime.date().toString(dateFormat) + " " + QObject::tr("(1 dive)");
+ ret = localTime.date().toString("MMM yy") + suffix;
}
return ret;