From bed86d525c953423c245c2dfb09dbec2bb3166d7 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 6 Dec 2019 12:31:19 +0000 Subject: [PATCH] Remove prefix "Last " when referring to dates in the past --- autotests/kformattest.cpp | 6 +++--- src/lib/util/kformatprivate.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autotests/kformattest.cpp b/autotests/kformattest.cpp index 7675058..bf18e45 100644 --- a/autotests/kformattest.cpp +++ b/autotests/kformattest.cpp @@ -356,11 +356,11 @@ void KFormatTest::formatRelativeDate() // format is only used when the date is outside the relative window testDate = QDate::currentDate().addDays(-7); QCOMPARE(format.formatRelativeDate(testDate, QLocale::LongFormat), - QStringLiteral("Last %1").arg(QLocale::c().dayName(testDate.dayOfWeek(), QLocale::LongFormat))); + QStringLiteral("%1").arg(QLocale::c().dayName(testDate.dayOfWeek(), QLocale::LongFormat))); QCOMPARE(format.formatRelativeDate(testDate, QLocale::ShortFormat), - QStringLiteral("Last %1").arg(QLocale::c().dayName(testDate.dayOfWeek(), QLocale::LongFormat))); + QStringLiteral("%1").arg(QLocale::c().dayName(testDate.dayOfWeek(), QLocale::LongFormat))); QCOMPARE(format.formatRelativeDate(testDate, QLocale::NarrowFormat), - QStringLiteral("Last %1").arg(QLocale::c().dayName(testDate.dayOfWeek(), QLocale::LongFormat))); + QStringLiteral("%1").arg(QLocale::c().dayName(testDate.dayOfWeek(), QLocale::LongFormat))); testDate = QDate::currentDate().addDays(7); QCOMPARE(format.formatRelativeDate(testDate, QLocale::LongFormat), diff --git a/src/lib/util/kformatprivate.cpp b/src/lib/util/kformatprivate.cpp index 83c8d17..0756463 100644 --- a/src/lib/util/kformatprivate.cpp +++ b/src/lib/util/kformatprivate.cpp @@ -526,19 +526,19 @@ QString KFormatPrivate::formatRelativeDate(const QDate &date, QLocale::FormatTyp if (daysTo < -1) { switch (date.dayOfWeek()) { case 1: - return tr("Last Monday", "most recent such day before today"); + return tr("Monday", "most recent such day before today"); case 2: - return tr("Last Tuesday", "most recent such day before today"); + return tr("Tuesday", "most recent such day before today"); case 3: - return tr("Last Wednesday", "most recent such day before today"); + return tr("Wednesday", "most recent such day before today"); case 4: - return tr("Last Thursday", "most recent such day before today"); + return tr("Thursday", "most recent such day before today"); case 5: - return tr("Last Friday", "most recent such day before today"); + return tr("Friday", "most recent such day before today"); case 6: - return tr("Last Saturday", "most recent such day before today"); + return tr("Saturday", "most recent such day before today"); case 7: - return tr("Last Sunday", "most recent such day before today"); + return tr("Sunday", "most recent such day before today"); } } else if (daysTo > 1) { switch (date.dayOfWeek()) { -- 2.24.0