diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | core/qthelper.cpp | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index c86059999..46243ae11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -- Tag: high level what changed (please replace this line with your first CHANGELOG entry) +- Desktop: translate trip date --- * Always add new entries at the very top of this file above other existing entries and this note. * Use this layout for new entries: `[Area]: [Details about the change] [reference thread / issue]` diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 7a41f2a3f..27d94e4f5 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -972,16 +972,12 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday) utc_mkdate(when, &tm); QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000*when,Qt::UTC); localTime.setTimeSpec(Qt::UTC); - QString ret ; QString suffix = " " + gettextFromC::tr("(%n dive(s))", "", nr); - if (getday) { - ret = localTime.date().toString(prefs.date_format) + suffix; - } else { - ret = localTime.date().toString("MMM yyyy") + suffix; - } - return ret; - + if (getday) + return loc.toString(localTime, prefs.date_format) + suffix; + else + return loc.toString(localTime, "MMM yyyy") + suffix; } static QMutex hashOfMutex; |