From 2d8f80d5f2a1595e43709fb14c13109cdf150c5c Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 8 Jan 2010 00:13:06 +0100 Subject: [PATCH] Fix regex for pofiles --- po/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 9e1d70f0..b7b3287f 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -6,11 +6,14 @@ 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}) -- 2.20.1