From cfd96a07b5b14abe1585f0edf68cd0b9c8975463 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 24 Sep 2026 17:38:52 +0200 Subject: docs: document the calendar, translate it, file its follow-ups Give RepeatRule its own Q_DECLARE_TR_FUNCTIONS context so lupdate extracts describe() and the ordinal words, mirroring the array's QT_TRANSLATE_NOOP; without it lupdate warned and RepeatRule/last was never extractable. --- src/repeatrule.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/repeatrule.cpp') diff --git a/src/repeatrule.cpp b/src/repeatrule.cpp index b9b9539..95a0ec3 100644 --- a/src/repeatrule.cpp +++ b/src/repeatrule.cpp @@ -18,7 +18,6 @@ #include "repeatrule.h" -#include #include #include @@ -58,13 +57,11 @@ const char *const kOrdinals[] = { QT_TRANSLATE_NOOP("RepeatRule", "fourth"), }; -QString tr(const char *text) { return QCoreApplication::translate("RepeatRule", text); } - QString ordinalWord(int ordinal) { if (ordinal == -1) - return tr("last"); - return (ordinal >= 1 && ordinal <= 4) ? tr(kOrdinals[ordinal - 1]) : QString(); + return RepeatRule::tr("last"); + return (ordinal >= 1 && ordinal <= 4) ? RepeatRule::tr(kOrdinals[ordinal - 1]) : QString(); } } // namespace -- cgit v1.2.3