[Pkg-owncloud-commits] [owncloud-client] 46/78: Utility: Better fix for the translation of minutes, seconds, ...

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Jun 24 16:29:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 275ad1e1576ab14c0eeb9a13fa210a995da65646
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu May 26 12:15:53 2016 +0200

    Utility: Better fix for the translation of minutes, seconds, ...
    
    The plural was not translated because of QTBUG-3945. Work around it.
    Issue #4855
---
 src/libsync/utility.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/libsync/utility.cpp b/src/libsync/utility.cpp
index 6a4b035..a80f2d7 100644
--- a/src/libsync/utility.cpp
+++ b/src/libsync/utility.cpp
@@ -310,13 +310,18 @@ namespace {
                     value);
         }
     };
+// QTBUG-3945 and issue #4855: QT_TRANSLATE_NOOP does not work with plural form because lupdate
+// limitation unless we fake more arguments
+// (it must be in the form ("context", "source", "comment", n)
+#undef QT_TRANSLATE_NOOP
+#define QT_TRANSLATE_NOOP(ctx, str, ...) str
     Q_DECL_CONSTEXPR Period periods[] = {
-        { QT_TRANSLATE_NOOP("Utility", "%n year(s)") , 365*24*3600*1000LL },
-        { QT_TRANSLATE_NOOP("Utility", "%n month(s)") , 30*24*3600*1000LL },
-        { QT_TRANSLATE_NOOP("Utility", "%n day(s)") , 24*3600*1000LL },
-        { QT_TRANSLATE_NOOP("Utility", "%n hour(s)") , 3600*1000LL },
-        { QT_TRANSLATE_NOOP("Utility", "%n minute(s)") , 60*1000LL },
-        { QT_TRANSLATE_NOOP("Utility", "%n second(s)") , 1000LL },
+        { QT_TRANSLATE_NOOP("Utility", "%n year(s)" , 0, _) , 365*24*3600*1000LL },
+        { QT_TRANSLATE_NOOP("Utility", "%n month(s)", 0, _) , 30*24*3600*1000LL },
+        { QT_TRANSLATE_NOOP("Utility", "%n day(s)", 0, _) , 24*3600*1000LL },
+        { QT_TRANSLATE_NOOP("Utility", "%n hour(s)", 0, _) , 3600*1000LL },
+        { QT_TRANSLATE_NOOP("Utility", "%n minute(s)", 0, _) , 60*1000LL },
+        { QT_TRANSLATE_NOOP("Utility", "%n second(s)", 0, _ ), 1000LL },
         { 0, 0 }
     };
 } // anonymous namespace

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list