From 0d26d1f21e6c435743b741cfdc32db06670430b3 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 4 Jan 2024 16:35:42 +0100 Subject: [PATCH] one step further to detect why translations are missing Signed-off-by: Matthieu Gallien --- src/gui/application.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 2f33bf59db046..3357e870064be 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -961,7 +961,12 @@ void Application::setupTranslations() for (QString lang : qAsConst(uiLanguages)) { lang.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973 lang = substLang(lang); - const QString trPath = applicationTrPath(); + const auto trPath = applicationTrPath(); + const auto trFolder = QDir{trPath}; + if (!trFolder.exists()) { + qCWarning(lcApplication()) << trPath << "folder containing translations is missing. Impossible to load translations"; + break; + } const QString trFile = QLatin1String("client_") + lang; qCInfo(lcApplication()) << "trying to load" << lang << "in" << trFile << "from" << trPath; if (translator->load(trFile, trPath) || lang.startsWith(QLatin1String("en"))) { @@ -995,6 +1000,8 @@ void Application::setupTranslations() break; } else { qCInfo(lcApplication()) << "translation catalog failed to load"; + const auto folderContent = trFolder.entryList(); + qCInfo(lcApplication()) << "folder content" << folderContent.join(QStringLiteral(", ")); } if (property("ui_lang").isNull()) { setProperty("ui_lang", "C");