mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
add more info before we try to load translations and/or fail
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
4714e01477
commit
452cf435fc
1 changed files with 11 additions and 1 deletions
|
@ -961,8 +961,14 @@ 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;
|
||||
qCDebug(lcApplication()) << "trying to load" << lang << "in" << trFile << "from" << trPath;
|
||||
if (translator->load(trFile, trPath) || lang.startsWith(QLatin1String("en"))) {
|
||||
// Permissive approach: Qt and keychain translations
|
||||
// may be missing, but Qt translations must be there in order
|
||||
|
@ -992,6 +998,10 @@ void Application::setupTranslations()
|
|||
if (!qtkeychainTranslator->isEmpty())
|
||||
installTranslator(qtkeychainTranslator);
|
||||
break;
|
||||
} else {
|
||||
qCWarning(lcApplication()) << "translation catalog failed to load";
|
||||
const auto folderContent = trFolder.entryList();
|
||||
qCDebug(lcApplication()) << "folder content" << folderContent.join(QStringLiteral(", "));
|
||||
}
|
||||
if (property("ui_lang").isNull()) {
|
||||
setProperty("ui_lang", "C");
|
||||
|
|
Loading…
Reference in a new issue