From c2f16bd20e1095115bf4916e4a87e6973e1608ca Mon Sep 17 00:00:00 2001 From: liuminghang Date: Mon, 28 Jun 2021 17:29:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8C=89=E7=85=A7=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=E5=BD=95=E5=B1=8F=E7=9A=84=E6=96=B9=E5=BC=8F=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 按照截图录屏的方式翻译 Log: 按照截图录屏的方式翻译 Change-Id: I74c041e1647fed0da5b1598bf8ef28512415ef6e --- deepin-ocr.pro | 41 ++++++++++++++++++++++---------- translations/deepin-ocr_zh_CN.ts | 19 --------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/deepin-ocr.pro b/deepin-ocr.pro index 0806324..a4eb28f 100644 --- a/deepin-ocr.pro +++ b/deepin-ocr.pro @@ -54,22 +54,24 @@ QT += dtkwidget target.path=/usr/bin ##翻译 -#isEmpty(TRANSLATIONS) { -# include(./translations.pri) -#} -CONFIG(release, debug|release) { - TRANSLATIONS = $$files($$PWD/translations/*.ts) - #遍历目录中的ts文件,调用lrelease将其生成为qm文件 - for(tsfile, TRANSLATIONS) { - qmfile = $$replace(tsfile, .ts$, .qm) - system(lrelease $$tsfile -qm $$qmfile) | error("Failed to lrelease") - } +isEmpty(TRANSLATIONS) { + include(./translations.pri) } +#CONFIG(release, debug|release) { +# TRANSLATIONS = $$files($$PWD/translations/*.ts) +# #遍历目录中的ts文件,调用lrelease将其生成为qm文件 +# for(tsfile, TRANSLATIONS) { +# qmfile = $$replace(tsfile, .ts$, .qm) +# system(lrelease $$tsfile -qm $$qmfile) | error("Failed to lrelease") +# } +#} TRANSLATIONS_COMPILED = $$TRANSLATIONS TRANSLATIONS_COMPILED ~= s/\.ts/.qm/g + translations.path=/usr/share/deepin-ocr/translations -#translations.files=$$TRANSLATIONS_COMPILED -translations.files=$$PWD/translations/*qm +translations.files = $$TRANSLATIONS_COMPILED + +#translations.files=$$PWD/translations/*qm #Dbus文件 dbus_service.path=/usr/share/dbus-1/services @@ -81,6 +83,21 @@ tesslangs.files=./assets/tesslangs/chi_sim.traineddata ./assets/tesslangs/chi_tr INSTALLS += target dbus_service translations tesslangs +CONFIG *= update_translations release_translations + +CONFIG(update_translations) { + isEmpty(lupdate):lupdate=lupdate + system($$lupdate -no-obsolete -locations none $$_PRO_FILE_) +} + +CONFIG(release_translations) { + isEmpty(lrelease):lrelease=lrelease + system($$lrelease $$_PRO_FILE_) +} + +DSR_LANG_PATH += $$DSRDIR/translations +DEFINES += "DSR_LANG_PATH=\\\"$$DSR_LANG_PATH\\\"" + RESOURCES += \ resource.qrc diff --git a/translations/deepin-ocr_zh_CN.ts b/translations/deepin-ocr_zh_CN.ts index 6972cef..f06836b 100644 --- a/translations/deepin-ocr_zh_CN.ts +++ b/translations/deepin-ocr_zh_CN.ts @@ -1,25 +1,6 @@ - - ImageView - - Save Image - 保存图片 - - - Open File - 打开文件 - - - error - 错误 - - - open file error - 打开文件错误 - - MainWidget