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

This commit is contained in:
kleidis 2024-08-18 09:25:24 +02:00
parent e1ff3b8dbe
commit 9d981c55e5

View file

@ -3093,8 +3093,9 @@ 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/")); QLocale defaultLocale = QLocale::system();
loaded = translator.load(defaultLocale, {}, {}, 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/"));