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 31, 2024
1 parent 5cc32f8 commit a9f6936
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

1 comment on commit a9f6936

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.