Skip to content

Commit

Permalink
one step further to detect why translations are missing
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Jan 4, 2024
1 parent 39374b5 commit 0d26d1f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))) {
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 0d26d1f

Please sign in to comment.