Use first uiLanguage as lang

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-11-17 23:10:49 +08:00 committed by Matthieu Gallien
parent befc8bff78
commit 81bd390820

View file

@ -968,7 +968,7 @@ QString substLang(const QString &lang)
void Application::setupTranslations() void Application::setupTranslations()
{ {
const auto enforcedLocale = Theme::instance()->enforcedLocale(); const auto enforcedLocale = Theme::instance()->enforcedLocale();
const auto lang = substLang(!enforcedLocale.isEmpty() ? enforcedLocale : QLocale::system().name()); const auto lang = substLang(!enforcedLocale.isEmpty() ? enforcedLocale : QLocale::system().uiLanguages(QLocale::TagSeparator::Underscore).first());
auto *translator = new QTranslator(this); auto *translator = new QTranslator(this);
auto *qtTranslator = new QTranslator(this); auto *qtTranslator = new QTranslator(this);