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

This commit is contained in:
kleidis 2024-08-15 13:30:54 +02:00 committed by OpenSauce
parent f004700127
commit e284607438

View file

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