From 4fa2a6e9aa8d4c689f04ab65df264f65b61ef858 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 13 Jul 2023 01:10:09 +0200 Subject: Fix qml translations --- src/main.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 07397d62..3984f4ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -334,10 +334,21 @@ main(int argc, char *argv[]) QTranslator qtTranslator; if (qtTranslator.load(QLocale(), - QStringLiteral("qt"), + QStringLiteral("qtbase"), QStringLiteral("_"), - QLibraryInfo::path(QLibraryInfo::TranslationsPath))) + QLibraryInfo::path(QLibraryInfo::TranslationsPath))) { app.installTranslator(&qtTranslator); + } else + qDebug() << "Failed to load qtbase translations: " + << QLibraryInfo::path(QLibraryInfo::TranslationsPath); + QTranslator qmlTranslator; + if (qmlTranslator.load(QLocale(), + QStringLiteral("qtdeclarative"), + QStringLiteral("_"), + QLibraryInfo::path(QLibraryInfo::TranslationsPath))) { + app.installTranslator(&qmlTranslator); + } else + qDebug() << "Failed to load qtdeclarative translations"; QTranslator appTranslator; if (appTranslator.load(QLocale(), @@ -345,6 +356,8 @@ main(int argc, char *argv[]) QStringLiteral("_"), QStringLiteral(":/translations"))) app.installTranslator(&appTranslator); + else + qDebug() << "Failed to load nheko translations"; MainWindow w(nullptr); // QQuickView w; -- cgit 1.4.1