Skip to content

Commit

Permalink
Also load qtbase translations (QDialogButtonBox buttons etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro authored and nyalldawson committed Jun 21, 2021
1 parent a29ce54 commit d5c3890
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/qgsapplication.cpp
Expand Up @@ -206,6 +206,16 @@ QgsApplication::QgsApplication( int &argc, char **argv, bool GUIenabled, const Q
{
QgsDebugMsgLevel( QStringLiteral( "loading of qt translation failed %1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), *sTranslation() ), 2 );
}

mQtBaseTranslator = new QTranslator();
if ( mQtBaseTranslator->load( QStringLiteral( "qtbase_" ) + *sTranslation(), QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ) )
{
installTranslator( mQtBaseTranslator );
}
else
{
QgsDebugMsg( QStringLiteral( "loading of qtbase translation failed %1/qtbase_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), *sTranslation() ) );
}
}

mApplicationMembers = new ApplicationMembers();
Expand Down Expand Up @@ -417,6 +427,7 @@ QgsApplication::~QgsApplication()
delete mApplicationMembers;
delete mQgisTranslator;
delete mQtTranslator;
delete mQtBaseTranslator;

// we do this here as well as in exitQgis() -- it's safe to call as often as we want,
// and there's just a *chance* that someone hasn't properly called exitQgis prior to
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsapplication.h
Expand Up @@ -1018,6 +1018,7 @@ class CORE_EXPORT QgsApplication : public QApplication

QTranslator *mQgisTranslator = nullptr;
QTranslator *mQtTranslator = nullptr;
QTranslator *mQtBaseTranslator = nullptr;

QgsDataItemProviderRegistry *mDataItemProviderRegistry = nullptr;
QgsAuthManager *mAuthManager = nullptr;
Expand Down

0 comments on commit d5c3890

Please sign in to comment.