From f81931ba5728ea5e564b60c45780a7bac277f3d7 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 9 Jul 2013 15:39:09 +0200 Subject: [PATCH] Assistant: ifdef qWarning about missing translations 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 --- src/assistant/assistant/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/assistant/assistant/main.cpp b/src/assistant/assistant/main.cpp index a9074fc..2f54d3d 100644 --- a/src/assistant/assistant/main.cpp +++ b/src/assistant/assistant/main.cpp @@ -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() -- 2.7.4