From 271b8b0d1ae716d2c69be714662281c34bf4b274 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Wed, 30 Oct 2024 11:23:16 +0700 Subject: [PATCH] Fix UI not following system language when available --- src/app/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 047a119891..10af8eaadc 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -116,11 +116,6 @@ int main( int argc, char **argv ) qfieldTranslatorLoaded = qfieldTranslator.load( QStringLiteral( "qfield_%1" ).arg( customLanguage ), QStringLiteral( ":/i18n/" ), "_" ); qtTranslatorLoaded = qtTranslator.load( QStringLiteral( "qt_%1" ).arg( customLanguage ), QStringLiteral( ":/i18n/" ), "_" ); } - if ( !qfieldTranslatorLoaded || qfieldTranslator.isEmpty() ) - ( void ) qfieldTranslator.load( QLocale(), "qfield", "_", ":/i18n/" ); - if ( !qtTranslatorLoaded || qtTranslator.isEmpty() ) - ( void ) qtTranslator.load( QLocale(), "qt", "_", ":/i18n/" ); - dummyApp->installTranslator( &qtTranslator ); dummyApp->installTranslator( &qfieldTranslator ); @@ -136,6 +131,11 @@ int main( int argc, char **argv ) QgsApplication app( argc, argv, true, profilePath, QStringLiteral( "mobile" ) ); + if ( !qfieldTranslatorLoaded || qfieldTranslator.isEmpty() ) + ( void ) qfieldTranslator.load( QStringLiteral( "qfield_%1" ).arg( QLocale().name() ), QStringLiteral( ":/i18n/" ), "_" ); + if ( !qtTranslatorLoaded || qtTranslator.isEmpty() ) + ( void ) qtTranslator.load( QStringLiteral( "qt_%1" ).arg( QLocale().name() ), QStringLiteral( ":/i18n/" ), "_" ); + if ( !customLanguage.isEmpty() ) { QLocale customLocale( customLanguage );