X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=po%2FCMakeLists.txt;h=9f8b2b274697ebaeaa74e11996c3639e5154efbf;hp=9e1d70f0df7f996b29bb03cf5de792acad249273;hb=f8de7b607c3e168996138cbc5e1cfca18254ba09;hpb=846ce2425763e175e0453f2b3c3a2feab35e58c9 diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 9e1d70f0..9f8b2b27 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -6,16 +6,20 @@ if(QT_LCONVERT_EXECUTABLE) set(LINGUAS "$ENV{LINGUAS}") string(REGEX REPLACE "[ \t]+" \; output "${LINGUAS}") # Find more languages - file(GLOB avail_pofiles *.po qt_*.po) + # We support xx.po and xx_YY.po, and additionally translations for qt using qt_xx.po or qt_xx_YY.po + file(GLOB avail_pofiles *.po) foreach(PO_FILE ${avail_pofiles}) get_filename_component(basename ${PO_FILE} NAME_WE) - string(REGEX REPLACE "q[^_]+_([a-zA-Z]+)(_.+)?$" "\\1" lang ${basename}) - # test if we want this + # CMake can't use MATCH to get the second catch... + string(REGEX REPLACE "(qt_)?([a-zA-Z]+)(_.+)?$" "\\2" lang ${basename}) + + # test if we want this language set(flg 1) if(LINGUAS) string(REGEX MATCH "${lang}" flg ${LINGUAS}) endif(LINGUAS) if(flg) + generate_ts(QM ${basename}) generate_qm(QM ${basename}) list(APPEND qm_files ${QM}) list(APPEND gen_linguas ${lang})