mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 20:16:16 +00:00
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>
This commit is contained in:
parent
f451387f8f
commit
9132390689
2 changed files with 5 additions and 8 deletions
|
@ -543,7 +543,7 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||
QString distance = distance_string(distanceMeters);
|
||||
int nr = nr_of_dives_at_dive_site(ds->uuid, false);
|
||||
bottomText += tr(" (~%1 away").arg(distance);
|
||||
bottomText += tr(", %1 dive(s) here)").arg(nr);
|
||||
bottomText += tr(", %n dive(s) here)", "", nr);
|
||||
}
|
||||
}
|
||||
if (bottomText.isEmpty()) {
|
||||
|
|
11
qthelper.cpp
11
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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue