windeployqt combines all translations into one file.

This commit is contained in:
Roman Telezhynskyi 2023-01-18 14:57:38 +02:00
parent 521c156736
commit 7b755b6130
2 changed files with 6 additions and 0 deletions

View File

@ -268,6 +268,7 @@ void VAbstractApplication::LoadTranslation(QString locale)
LoadQM(qtTranslator, QStringLiteral("qt_"), locale, qtQmDir); LoadQM(qtTranslator, QStringLiteral("qt_"), locale, qtQmDir);
installTranslator(qtTranslator); installTranslator(qtTranslator);
#if defined(Q_OS_WIN) && !defined(QBS_BUILD)
qtxmlTranslator = new QTranslator(this); qtxmlTranslator = new QTranslator(this);
LoadQM(qtxmlTranslator, QStringLiteral("qtxmlpatterns_"), locale, qtQmDir); LoadQM(qtxmlTranslator, QStringLiteral("qtxmlpatterns_"), locale, qtQmDir);
installTranslator(qtxmlTranslator); installTranslator(qtxmlTranslator);
@ -275,6 +276,7 @@ void VAbstractApplication::LoadTranslation(QString locale)
qtBaseTranslator = new QTranslator(this); qtBaseTranslator = new QTranslator(this);
LoadQM(qtBaseTranslator, QStringLiteral("qtbase_"), locale, qtQmDir); LoadQM(qtBaseTranslator, QStringLiteral("qtbase_"), locale, qtQmDir);
installTranslator(qtBaseTranslator); installTranslator(qtBaseTranslator);
#endif // defined(Q_OS_WIN) && !defined(QBS_BUILD)
appTranslator = new QTranslator(this); appTranslator = new QTranslator(this);
LoadQM(appTranslator, QStringLiteral("valentina_"), locale, appQmDir); LoadQM(appTranslator, QStringLiteral("valentina_"), locale, appQmDir);
@ -296,6 +298,7 @@ void VAbstractApplication::ClearTranslation()
delete qtTranslator; delete qtTranslator;
} }
#if defined(Q_OS_WIN) && !defined(QBS_BUILD)
if (not qtxmlTranslator.isNull()) if (not qtxmlTranslator.isNull())
{ {
removeTranslator(qtxmlTranslator); removeTranslator(qtxmlTranslator);
@ -307,6 +310,7 @@ void VAbstractApplication::ClearTranslation()
removeTranslator(qtBaseTranslator); removeTranslator(qtBaseTranslator);
delete qtBaseTranslator; delete qtBaseTranslator;
} }
#endif // defined(Q_OS_WIN) && !defined(QBS_BUILD)
if (not appTranslator.isNull()) if (not appTranslator.isNull())
{ {

View File

@ -99,8 +99,10 @@ protected:
VCommonSettings *settings{nullptr}; VCommonSettings *settings{nullptr};
QPointer<QTranslator> qtTranslator{nullptr}; QPointer<QTranslator> qtTranslator{nullptr};
#if defined(Q_OS_WIN) && !defined(QBS_BUILD)
QPointer<QTranslator> qtxmlTranslator{nullptr}; QPointer<QTranslator> qtxmlTranslator{nullptr};
QPointer<QTranslator> qtBaseTranslator{nullptr}; QPointer<QTranslator> qtBaseTranslator{nullptr};
#endif // defined(Q_OS_WIN) && !defined(QBS_BUILD)
QPointer<QTranslator> appTranslator{nullptr}; QPointer<QTranslator> appTranslator{nullptr};
QPointer<QTranslator> pmsTranslator{nullptr}; QPointer<QTranslator> pmsTranslator{nullptr};