qt: Fix default language not being set to the main one the system uses (#236)

* qt: Fix default language not being set to the main one the system uses

* cleanup code
This commit is contained in:
kleidis 2024-08-21 19:59:07 +02:00 committed by GitHub
parent e1ff3b8dbe
commit d8760dee6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3093,8 +3093,8 @@ void GMainWindow::LoadTranslation() {
bool loaded; bool loaded;
if (UISettings::values.language.isEmpty()) { if (UISettings::values.language.isEmpty()) {
// If the selected language is empty, use system locale // Use the system's default locale
loaded = translator.load(QLocale(), {}, {}, QStringLiteral(":/languages/")); loaded = translator.load(QLocale::system(), {}, {}, QStringLiteral(":/languages/"));
} else { } else {
// Otherwise load from the specified file // Otherwise load from the specified file
loaded = translator.load(UISettings::values.language, QStringLiteral(":/languages/")); loaded = translator.load(UISettings::values.language, QStringLiteral(":/languages/"));