Skip to content

Commit

Permalink
Fix language detection
Browse files Browse the repository at this point in the history
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
  • Loading branch information
grulja committed Nov 22, 2024
1 parent bb450a6 commit 2bbf618
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2bbf618

Please # to comment.