update messagebox
This commit is contained in:
parent
302694578c
commit
3bad2cc7cd
@ -11,6 +11,7 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "common/SpdLogger.h"
|
||||||
|
|
||||||
template<> RecourceHelper* Singleton<RecourceHelper>::instance_ = nullptr;
|
template<> RecourceHelper* Singleton<RecourceHelper>::instance_ = nullptr;
|
||||||
RecourceHelper::RecourceHelper(QObject* parent)
|
RecourceHelper::RecourceHelper(QObject* parent)
|
||||||
@ -72,7 +73,7 @@ void RecourceHelper::Init() {
|
|||||||
if (fontName.count() > 0) {
|
if (fontName.count() > 0) {
|
||||||
iconFont_ = QFont(fontName.at(0));
|
iconFont_ = QFont(fontName.at(0));
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "fontName count <= 0 error";
|
LOG_WARN("fontName count <= 0 error");
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString appName = QApplication::applicationDisplayName();
|
const QString appName = QApplication::applicationDisplayName();
|
||||||
@ -83,8 +84,18 @@ void RecourceHelper::Init() {
|
|||||||
#endif
|
#endif
|
||||||
qDebug() << transName;
|
qDebug() << transName;
|
||||||
bool success = trans_.load(transName);
|
bool success = trans_.load(transName);
|
||||||
if (!success) {
|
if (success) {
|
||||||
qDebug() << "load translations error";
|
QApplication::installTranslator(&trans_);
|
||||||
|
} else {
|
||||||
|
LOG_WARN("load translations error: {}", transName.toStdString());
|
||||||
}
|
}
|
||||||
QApplication::installTranslator(&trans_);
|
|
||||||
|
const QString systemTransName = QString("./translations/qt_%1.qm").arg( QLocale::system().name());
|
||||||
|
success = systemTrans_.load(systemTransName);
|
||||||
|
if (success) {
|
||||||
|
QApplication::installTranslator(&systemTrans_);
|
||||||
|
} else {
|
||||||
|
LOG_WARN("load translations error: {}", systemTransName.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,4 +33,5 @@ private:
|
|||||||
private:
|
private:
|
||||||
QFont iconFont_;
|
QFont iconFont_;
|
||||||
QTranslator trans_;
|
QTranslator trans_;
|
||||||
|
QTranslator systemTrans_;
|
||||||
};
|
};
|
||||||
|
BIN
src/translations/qt_zh_CN.qm
Normal file
BIN
src/translations/qt_zh_CN.qm
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user