Load also qtbase_*.qm files.
--HG-- branch : develop
This commit is contained in:
parent
cdec047f58
commit
0473db2947
|
@ -42,6 +42,7 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv)
|
|||
settings(nullptr),
|
||||
qtTranslator(nullptr),
|
||||
qtxmlTranslator(nullptr),
|
||||
qtBaseTranslator(nullptr),
|
||||
appTranslator(nullptr),
|
||||
pmsTranslator(nullptr),
|
||||
_patternUnit(Unit::Cm),
|
||||
|
@ -233,6 +234,14 @@ void VAbstractApplication::LoadTranslation(const QString &locale)
|
|||
#endif
|
||||
installTranslator(qtxmlTranslator);
|
||||
|
||||
qtBaseTranslator = new QTranslator(this);
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||
qtBaseTranslator->load("qtbase_" + locale, translationsPath(locale));
|
||||
#else
|
||||
qtBaseTranslator->load("qtbase_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
#endif
|
||||
installTranslator(qtBaseTranslator);
|
||||
|
||||
appTranslator = new QTranslator(this);
|
||||
appTranslator->load("valentina_" + locale, translationsPath(locale));
|
||||
installTranslator(appTranslator);
|
||||
|
@ -261,6 +270,12 @@ void VAbstractApplication::ClearTranslation()
|
|||
delete qtxmlTranslator;
|
||||
}
|
||||
|
||||
if (not qtBaseTranslator.isNull())
|
||||
{
|
||||
removeTranslator(qtBaseTranslator);
|
||||
delete qtBaseTranslator;
|
||||
}
|
||||
|
||||
if (not appTranslator.isNull())
|
||||
{
|
||||
removeTranslator(appTranslator);
|
||||
|
|
|
@ -118,6 +118,7 @@ protected:
|
|||
|
||||
QPointer<QTranslator> qtTranslator;
|
||||
QPointer<QTranslator> qtxmlTranslator;
|
||||
QPointer<QTranslator> qtBaseTranslator;
|
||||
QPointer<QTranslator> appTranslator;
|
||||
QPointer<QTranslator> pmsTranslator;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user