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),
|
settings(nullptr),
|
||||||
qtTranslator(nullptr),
|
qtTranslator(nullptr),
|
||||||
qtxmlTranslator(nullptr),
|
qtxmlTranslator(nullptr),
|
||||||
|
qtBaseTranslator(nullptr),
|
||||||
appTranslator(nullptr),
|
appTranslator(nullptr),
|
||||||
pmsTranslator(nullptr),
|
pmsTranslator(nullptr),
|
||||||
_patternUnit(Unit::Cm),
|
_patternUnit(Unit::Cm),
|
||||||
|
@ -233,6 +234,14 @@ void VAbstractApplication::LoadTranslation(const QString &locale)
|
||||||
#endif
|
#endif
|
||||||
installTranslator(qtxmlTranslator);
|
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 = new QTranslator(this);
|
||||||
appTranslator->load("valentina_" + locale, translationsPath(locale));
|
appTranslator->load("valentina_" + locale, translationsPath(locale));
|
||||||
installTranslator(appTranslator);
|
installTranslator(appTranslator);
|
||||||
|
@ -261,6 +270,12 @@ void VAbstractApplication::ClearTranslation()
|
||||||
delete qtxmlTranslator;
|
delete qtxmlTranslator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (not qtBaseTranslator.isNull())
|
||||||
|
{
|
||||||
|
removeTranslator(qtBaseTranslator);
|
||||||
|
delete qtBaseTranslator;
|
||||||
|
}
|
||||||
|
|
||||||
if (not appTranslator.isNull())
|
if (not appTranslator.isNull())
|
||||||
{
|
{
|
||||||
removeTranslator(appTranslator);
|
removeTranslator(appTranslator);
|
||||||
|
|
|
@ -118,6 +118,7 @@ protected:
|
||||||
|
|
||||||
QPointer<QTranslator> qtTranslator;
|
QPointer<QTranslator> qtTranslator;
|
||||||
QPointer<QTranslator> qtxmlTranslator;
|
QPointer<QTranslator> qtxmlTranslator;
|
||||||
|
QPointer<QTranslator> qtBaseTranslator;
|
||||||
QPointer<QTranslator> appTranslator;
|
QPointer<QTranslator> appTranslator;
|
||||||
QPointer<QTranslator> pmsTranslator;
|
QPointer<QTranslator> pmsTranslator;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user