Fix loadTranslation for QT 6 older than 6.7 (#2200)

* language fix for QT pre 6.7

haha funny number

* be more explicit

* make clang-format happy
This commit is contained in:
Cobalt 2026-06-17 08:37:55 -05:00 committed by GitHub
parent 176cd5cf14
commit 28960bf166
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4091,7 +4091,14 @@ void GMainWindow::LoadTranslation() {
// selected language option? Current behaviour is better than the issue it fixes,
// but not ideal.
if (UISettings::values.language.isEmpty()) {
const auto languages = QLocale::system().uiLanguages(QLocale::TagSeparator::Underscore);
QStringList languages;
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
languages = QLocale::system().uiLanguages(QLocale::TagSeparator::Underscore);
#else
languages = QLocale::system().uiLanguages();
for (auto& lang : languages)
lang.replace(u'-', u'_');
#endif
for (const auto& lang : languages) {
// If the first language found is English, no need to install any translation
if (lang == lang_en) {