From 2bbf618d7d8d4fb94c86b24877fce8dc8a2d239a Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 21 Nov 2024 13:04:43 +0100 Subject: [PATCH] Fix language detection Using QLocale::system() gives the correct locale, but uiLanguages() can give us language we don't want to. Instead just construct a new QLocale with the language reported as primary by QLocale::system(). Fixes #271 --- src/app/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index eb09fd7a..956c4a4b 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -51,7 +51,7 @@ int main(int argc, char **argv) mDebug() << "Application constructed"; QTranslator translator; - if (translator.load(QLocale(), QLatin1String(), QLatin1String(), ":/translations")) + if (translator.load(QLocale(QLocale::system().language()), QLatin1String(), QLatin1String(), ":/translations")) app.installTranslator(&translator); QGuiApplication::setDesktopFileName("org.fedoraproject.MediaWriter.desktop");