fix(frontend): QFileDialog is incompletely translated.

Description: 修复文件选择弹窗汉化不完整的bug

Log: 修复文件选择弹窗汉化不完整的bug
Bug: http://172.17.66.192/biz/bug-view-35800.html
This commit is contained in:
zhangjiaping 2021-02-02 15:15:37 +08:00
parent 7289562d17
commit c47efa1ab1
3 changed files with 10 additions and 0 deletions

View File

@ -200,6 +200,15 @@ int main(int argc, char *argv[])
qDebug() << "Load translations file" << QLocale() << "failed!"; qDebug() << "Load translations file" << QLocale() << "failed!";
} }
QTranslator qt_translator;
try {
if (! qt_translator.load(":/res/qt-translations/qt_zh_CN.qm")) throw -1;
app.installTranslator(&qt_translator);
} catch (...) {
qDebug() << "Load translations file" << QLocale() << "failed!";
}
MainWindow *w = new MainWindow; MainWindow *w = new MainWindow;
QStringList arguments = QCoreApplication::arguments(); QStringList arguments = QCoreApplication::arguments();
// centerToScreen(w); // centerToScreen(w);

View File

@ -3,5 +3,6 @@
<file>res/icons/edit-find-symbolic.svg</file> <file>res/icons/edit-find-symbolic.svg</file>
<file>res/icons/desktop.png</file> <file>res/icons/desktop.png</file>
<file>res/icons/close.svg</file> <file>res/icons/close.svg</file>
<file>res/qt-translations/qt_zh_CN.qm</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.