diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index 64c52d4d..75375d8a 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -3,8 +3,9 @@ set(TS_FILES xca_fr.ts xca_ja.ts xca_pt_BR.ts xca_tr.ts xca_de.ts xca_hr.ts xca_nl.ts xca_ru.ts xca_es.ts xca_it.ts xca_pl.ts xca_sk.ts -xca_zh_CN.ts +xca_zh_CN.ts xca.ts ) + qt5_add_translation(QM_FILES ${TS_FILES}) list(APPEND APP_RESOURCES ${QM_FILES}) set(APP_RESOURCES ${APP_RESOURCES} PARENT_SCOPE) @@ -18,20 +19,10 @@ if (UNIX) ) endif() -macro(PO_language lang) - add_custom_command( - OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/xca_${lang}X.ts" - COMMAND ${LCONVERT} -if po -of ts - -i "${CMAKE_CURRENT_SOURCE_DIR}/${lang}.po" - -o "${CMAKE_CURRENT_SOURCE_DIR}/xca_${lang}X.ts" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${lang}.po" - ) - list(APPEND POTS "${CMAKE_CURRENT_SOURCE_DIR}/xca_${lang}.ts") -endmacro() - find_program(LCONVERT lconvert) -if (LCONVERT) +# cmake -DTRANS=1 ../xca && make trans +if (LCONVERT AND TRANS) add_custom_command( OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/xca.pot" COMMAND ${LCONVERT} -if ts -of po @@ -41,12 +32,8 @@ if (LCONVERT) COMMENT "Update POT file" ) qt5_create_translation(CQM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) - PO_language(tr) - PO_language(fr) - PO_language(sk) -endif() -add_custom_target(trans DEPENDS ${CQM_FILES} + add_custom_target(trans DEPENDS ${CQM_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/xca.pot" -) -add_custom_target(po2ts DEPENDS ${POTS}) + ) +endif() diff --git a/lang/po2ts.sh b/lang/po2ts.sh new file mode 100755 index 00000000..ae2c5cfb --- /dev/null +++ b/lang/po2ts.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +ALL="$@" +test -n "$ALL" || ALL="tr fr sk" +for lang in $ALL; do + lconvert -if po -of ts -i "${lang}.po" -o "xca_${lang}.ts" +done