From c47efa1ab16b9d13290f84499fa74bd5b5234fae Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Tue, 2 Feb 2021 15:15:37 +0800 Subject: [PATCH] fix(frontend): QFileDialog is incompletely translated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 修复文件选择弹窗汉化不完整的bug Log: 修复文件选择弹窗汉化不完整的bug Bug: http://172.17.66.192/biz/bug-view-35800.html --- src/main.cpp | 9 +++++++++ src/resource.qrc | 1 + translations/libsearch/libukui-search_zh_CN.qm | Bin 0 -> 459 bytes 3 files changed, 10 insertions(+) create mode 100644 translations/libsearch/libukui-search_zh_CN.qm diff --git a/src/main.cpp b/src/main.cpp index c9c93a2..96dfe06 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -200,6 +200,15 @@ int main(int argc, char *argv[]) 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; QStringList arguments = QCoreApplication::arguments(); // centerToScreen(w); diff --git a/src/resource.qrc b/src/resource.qrc index 604a395..802cd34 100644 --- a/src/resource.qrc +++ b/src/resource.qrc @@ -3,5 +3,6 @@ res/icons/edit-find-symbolic.svg res/icons/desktop.png res/icons/close.svg + res/qt-translations/qt_zh_CN.qm diff --git a/translations/libsearch/libukui-search_zh_CN.qm b/translations/libsearch/libukui-search_zh_CN.qm new file mode 100644 index 0000000000000000000000000000000000000000..cea8f4b59ed48061148784c66a410c01dc37bb35 GIT binary patch literal 459 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJZf;}lw5J*2{zu3(Pq#5|H>``Q3V6@5v5;K{B z0xl^swMxOS{G~v2sYa4{*}M2qKkl-Y)ONpb|9N8kTW$S#!!?j)df&&lr0M4@Oy^AG z_wy`k`OnA!GMWvDt2`Bw6Y~`E^KvQ`ic=Gdk~0)4^Gk~qN{dsA6jCyaQj<&aiz;;# zGD{Rv@>7fR)Jqg{6SGql67xXn^NLdyGSfgh6q0iCle2-s2u%v*8JR%iGK&@R@=Fvl z^U%yxWCvQ$=bn?Fl$aBoT2hjkmtM>W@}Q8vLSSm}q0|CD-iE(^R#jC<&Q$?B7wCwh z)ZF|skTVoga|=o;6$%ndG8BqSih!ozG*~K0u&kxX3=~e0ma(7e&UdT^hgKVs1xmgk fvx-vlN)*!ab5ekTkdaudkd&I52k~KQ3RdF*%FUEw literal 0 HcmV?d00001