Assistant: ifdef qWarning about missing translations
authorShawn Rutledge <shawn.rutledge@digia.com>
Tue, 9 Jul 2013 13:39:09 +0000 (15:39 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 10 Jul 2013 05:28:23 +0000 (07:28 +0200)
There's no reason for only assistant to do this, and there are enough
missing translations that a lot of users will tend to see this message.

Task-number: QTBUG-31747
Change-Id: I333d15eaeb603e4c64a1a12791b4f94658b80e80
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
src/assistant/assistant/main.cpp

index a9074fc..2f54d3d 100644 (file)
@@ -70,6 +70,7 @@
 #include "cmdlineparser.h"
 
 // #define TRACING_REQUESTED
+// #define DEBUG_TRANSLATIONS
 
 QT_USE_NAMESPACE
 
@@ -284,13 +285,15 @@ bool unregisterDocumentation(QHelpEngineCore &collection,
 void setupTranslation(const QString &fileName, const QString &dir)
 {
     QTranslator *translator = new QTranslator(QCoreApplication::instance());
-    if (translator->load(fileName, dir)) {
+    if (translator->load(fileName, dir))
         QCoreApplication::installTranslator(translator);
-    } else if (!fileName.endsWith(QLatin1String("en_US"))
-            && !fileName.endsWith(QLatin1String("_C"))) {
-        qWarning("Could not load translation file %s in directory %s.",
-                 qPrintable(fileName), qPrintable(dir));
+#ifdef DEBUG_TRANSLATIONS
+    else if (!fileName.endsWith(QLatin1String("en_US"))
+             && !fileName.endsWith(QLatin1String("_C"))) {
+        qDebug("Could not load translation file %s in directory %s.",
+               qPrintable(fileName), qPrintable(dir));
     }
+#endif
 }
 
 void setupTranslations()