diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-06-08 13:24:31 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-06-13 09:38:15 +0300 |
commit | 062b11d28907994d0b08c38de696ee461c39f53e (patch) | |
tree | 8ca04cd99b0621526c5608f35b1971d2dea8093d /src | |
parent | bedd9d10c2804d7d0478d0d9f619619be918484f (diff) |
Print developer warning message when loading translation file fails
This is non-visible when running with lower than maximum verbosity or
custom logging rules. But when enabled it provides at least some
information for the packager about the point of failure - was it with
loading of the Qt or the IFW translation for a certain language.
Unfortunately didn't find a way to get details about the reason of
the failure.
Task-number: QTIFW-2658
Change-Id: I7ac3991810ab9dbb14cb941a1d95783141486928
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/sdk/sdkapp.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sdk/sdkapp.h b/src/sdk/sdkapp.h index 8a9423edc..cbd410b80 100644 --- a/src/sdk/sdkapp.h +++ b/src/sdk/sdkapp.h @@ -219,13 +219,20 @@ public: bool ifwLoaded = ifwTranslator->load(locale, QLatin1String("ifw"), QLatin1String("_"), newDirectory); if (!ifwLoaded) ifwLoaded = ifwTranslator->load(locale, QLatin1String("ifw"), QLatin1String("_"), directory); - if (ifwLoaded) + if (ifwLoaded) { QCoreApplication::instance()->installTranslator(ifwTranslator.take()); + } else { + qCWarning(QInstaller::lcDeveloperBuild) << "Could not load IFW translation for language" + << QLocale::languageToString(locale.language()); + } // To stop loading other translations it's sufficient that // qt was loaded successfully or we hit English as system language lang = locale; break; + } else { + qCWarning(QInstaller::lcDeveloperBuild) << "Could not load Qt translation for language" + << QLocale::languageToString(locale.language()); } } } else { |