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