Skip to content

Commit

Permalink
Fix UI not following system language when available
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Oct 30, 2024
1 parent 73bf646 commit 6266a59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand All @@ -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 );
Expand Down

0 comments on commit 6266a59

Please sign in to comment.