Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Preinstall default QTranslators before displaying the profile selecto…
…r dialog
  • Loading branch information
YoannQDQ authored and nyalldawson committed Apr 24, 2023
1 parent 99f4533 commit 583eeee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/main.cpp
Expand Up @@ -1015,6 +1015,18 @@ int main( int argc, char *argv[] )
// profile selection dialog if needed
QgsApplication myApp( argc, argv, myUseGuiFlag, QString(), QStringLiteral( "desktop" ) );

// Preload the translation. The GUI is not yet initilaized, so only
// the profile selection dialog will be translated with the system locale, or
// the one specified with --lang
if ( !translationCode.isNull() && !translationCode.isEmpty() )
{
QgsApplication::setTranslation( translationCode );
}
else
{
QgsApplication::setTranslation( QLocale().name() );
}

QString rootProfileFolder = QgsUserProfileManager::resolveProfilesFolder( configLocalStorageLocation );
QgsUserProfileManager manager( rootProfileFolder );

Expand Down

0 comments on commit 583eeee

Please sign in to comment.