diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-12-02 16:47:00 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-12-09 16:42:46 +0100 |
commit | a07b08c92d7a3ae296aa6c20ef3c19aeb6020fb3 (patch) | |
tree | 253e9aa525c0179a9739afc036f619d25cf6f023 | |
parent | 9a06da7515ae1a6b3975e2ff001f2d5de6e04762 (diff) | |
download | tdelibs-a07b08c92d7a3ae296aa6c20ef3c19aeb6020fb3.tar.gz tdelibs-a07b08c92d7a3ae296aa6c20ef3c19aeb6020fb3.zip |
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 707d60c602a5bed23be354ea362ea7c24a87fb0b)
38 files changed, 281 insertions, 0 deletions
diff --git a/CMakeL10n.txt b/CMakeL10n.txt new file mode 100644 index 000000000..bc73da47d --- /dev/null +++ b/CMakeL10n.txt @@ -0,0 +1,96 @@ +################################################# +# +# (C) 2018 Slávek Banko +# slavek.banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +cmake_minimum_required( VERSION 2.8 ) + + +##### include our cmake modules ################# + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEL10n ) + + +##### set directory for POT files ############### + +set( POT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../tde-i18n/template/messages/tdelibs" ) + + +##### verify tqt3 sources ####################### + +if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src ) + tde_message_fatal( "TQt3 source code is required but not found" ) +endif( ) + + +##### prepare tqt3/src/xml/qxml.cpp ############# + +if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp ) + # hide "#define" to allow strings to be extracted using xgettext + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp _tqt_qxml ) + string( REGEX REPLACE "\n(#define[^\n]*)(QT_TRANSLATE_NOOP)" "\n/*\\1*/\\2" _tqt_qxml ${_tqt_qxml} ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n "${_tqt_qxml}" ) +endif( ) + + +##### generate tdeabc/addressee files ########### + +execute_process( + COMMAND perl ./makeaddressee + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/scripts +) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "tdelibs" + SOURCES + "." + "tdecore/tde-config.cpp.cmake" + "../dependencies/tqt3/src" + "../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n" + EXCLUDES + "/test/" "/tests/" + "^arts/kde/mcop-dcop/" + "^arts/knotify/" + "^interfaces/tdemediaplayer/tdefileaudiopreview/" + "^kate/" + "^kdoctools/" + "^libtdescreensaver/" + "^tdeabc/formats/" + "^tdeabc/plugins/" + "^tdecmshell/" + "^tdecore/tdeconfig_compiler/example/" + "^tdeio/" + "^tdeioslave/" + "^tdeprint/" + "^tdeui/colors/" + "^tdestyles/.*/config/" + "/dependencies/tqt3/src/xml/qxml.cpp$" + KEYWORDS + tr tr:1,2 + translate translate:1,2 + QT_TRANSLATE_NOOP QT_TRANSLATE_NOOP:1,2 +) + + +##### clenaup tdeabc/addressee files ############ + +file( REMOVE + ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/addressee.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/addressee.h + ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/field.cpp +) + + +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/arts/CMakeL10n.txt b/arts/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/arts/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/arts/kde/CMakeL10n.txt b/arts/kde/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/arts/kde/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/arts/kde/mcop-dcop/CMakeL10n.txt b/arts/kde/mcop-dcop/CMakeL10n.txt new file mode 100644 index 000000000..dd4b625cd --- /dev/null +++ b/arts/kde/mcop-dcop/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kmcop" ) diff --git a/arts/knotify/CMakeL10n.txt b/arts/knotify/CMakeL10n.txt new file mode 100644 index 000000000..422cd20e0 --- /dev/null +++ b/arts/knotify/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "knotify" ) diff --git a/interfaces/CMakeL10n.txt b/interfaces/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/interfaces/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/interfaces/tdemediaplayer/CMakeL10n.txt b/interfaces/tdemediaplayer/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/interfaces/tdemediaplayer/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeL10n.txt b/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeL10n.txt new file mode 100644 index 000000000..67f5058fb --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdefileaudiopreview" ) diff --git a/kate/CMakeL10n.txt b/kate/CMakeL10n.txt new file mode 100644 index 000000000..e2998f650 --- /dev/null +++ b/kate/CMakeL10n.txt @@ -0,0 +1,11 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "katepart" + SOURCES data part plugins + ATTRIBUTES + "data/*.xml:language,section,Language Section" + "data/*.xml:language,name,Language" +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/kate/plugins/CMakeL10n.txt b/kate/plugins/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/kate/plugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/kate/plugins/autobookmarker/CMakeL10n.txt b/kate/plugins/autobookmarker/CMakeL10n.txt new file mode 100644 index 000000000..e2c816b8b --- /dev/null +++ b/kate/plugins/autobookmarker/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdetexteditor_autobookmarker" ) diff --git a/kate/plugins/insertfile/CMakeL10n.txt b/kate/plugins/insertfile/CMakeL10n.txt new file mode 100644 index 000000000..3679577e2 --- /dev/null +++ b/kate/plugins/insertfile/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdetexteditor_insertfile" ) diff --git a/kate/plugins/isearch/CMakeL10n.txt b/kate/plugins/isearch/CMakeL10n.txt new file mode 100644 index 000000000..49b82b1ff --- /dev/null +++ b/kate/plugins/isearch/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdetexteditor_isearch" ) diff --git a/kate/plugins/kdatatool/CMakeL10n.txt b/kate/plugins/kdatatool/CMakeL10n.txt new file mode 100644 index 000000000..c0390848f --- /dev/null +++ b/kate/plugins/kdatatool/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdetexteditor_kdatatool" ) diff --git a/kate/plugins/wordcompletion/CMakeL10n.txt b/kate/plugins/wordcompletion/CMakeL10n.txt new file mode 100644 index 000000000..54d0ca4d6 --- /dev/null +++ b/kate/plugins/wordcompletion/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdetexteditor_docwordcompletion" ) diff --git a/kdoctools/CMakeL10n.txt b/kdoctools/CMakeL10n.txt new file mode 100644 index 000000000..ef890c85c --- /dev/null +++ b/kdoctools/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeio_help" ) diff --git a/libtdescreensaver/CMakeL10n.txt b/libtdescreensaver/CMakeL10n.txt new file mode 100644 index 000000000..d159b082e --- /dev/null +++ b/libtdescreensaver/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "libtdescreensaver" ) diff --git a/tdeabc/CMakeL10n.txt b/tdeabc/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdeabc/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdeabc/formats/CMakeL10n.txt b/tdeabc/formats/CMakeL10n.txt new file mode 100644 index 000000000..6559e4402 --- /dev/null +++ b/tdeabc/formats/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeabcformat_binary" ) diff --git a/tdeabc/plugins/CMakeL10n.txt b/tdeabc/plugins/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdeabc/plugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdeabc/plugins/dir/CMakeL10n.txt b/tdeabc/plugins/dir/CMakeL10n.txt new file mode 100644 index 000000000..e9b1904d4 --- /dev/null +++ b/tdeabc/plugins/dir/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeabc_dir" ) diff --git a/tdeabc/plugins/file/CMakeL10n.txt b/tdeabc/plugins/file/CMakeL10n.txt new file mode 100644 index 000000000..d9b76401c --- /dev/null +++ b/tdeabc/plugins/file/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeabc_file" ) diff --git a/tdeabc/plugins/ldaptdeio/CMakeL10n.txt b/tdeabc/plugins/ldaptdeio/CMakeL10n.txt new file mode 100644 index 000000000..5472a778f --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeabc_ldaptdeio" ) diff --git a/tdeabc/plugins/net/CMakeL10n.txt b/tdeabc/plugins/net/CMakeL10n.txt new file mode 100644 index 000000000..af535cdd4 --- /dev/null +++ b/tdeabc/plugins/net/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeabc_net" ) diff --git a/tdeabc/plugins/sql/CMakeL10n.txt b/tdeabc/plugins/sql/CMakeL10n.txt new file mode 100644 index 000000000..5452d3d8b --- /dev/null +++ b/tdeabc/plugins/sql/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeabc_sql" ) diff --git a/tdecmshell/CMakeL10n.txt b/tdecmshell/CMakeL10n.txt new file mode 100644 index 000000000..285aecd83 --- /dev/null +++ b/tdecmshell/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdecmshell" ) diff --git a/tdeio/CMakeL10n.txt b/tdeio/CMakeL10n.txt new file mode 100644 index 000000000..c25fe7c6b --- /dev/null +++ b/tdeio/CMakeL10n.txt @@ -0,0 +1,8 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "tdeio" + SOURCES "." "../tdeioslave" +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdeio/tdeioexec/CMakeL10n.txt b/tdeio/tdeioexec/CMakeL10n.txt new file mode 100644 index 000000000..8efb57d56 --- /dev/null +++ b/tdeio/tdeioexec/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdeioexec" ) diff --git a/tdeprint/CMakeL10n.txt b/tdeprint/CMakeL10n.txt new file mode 100644 index 000000000..39b00b619 --- /dev/null +++ b/tdeprint/CMakeL10n.txt @@ -0,0 +1,8 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "tdeprint" + EXCLUDES "^cups/cupsdconf2/" +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdeprint/cups/CMakeL10n.txt b/tdeprint/cups/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdeprint/cups/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdeprint/cups/cupsdconf2/CMakeL10n.txt b/tdeprint/cups/cupsdconf2/CMakeL10n.txt new file mode 100644 index 000000000..015135199 --- /dev/null +++ b/tdeprint/cups/cupsdconf2/CMakeL10n.txt @@ -0,0 +1,40 @@ +##### prepare cupsd.conf.template as C source ### + +set( _conf_context "Do not translate the keyword between brackets (e.g. ServerName, ServerAdmin, etc.)" ) +file( READ ${CMAKE_CURRENT_SOURCE_DIR}/cupsd.conf.template _conf_template ) +string( REGEX REPLACE "[^\n]" "" _conf_len "${_conf_template}" ) +string( LENGTH "+${_conf_len}" _conf_len ) +unset( _conf_comment ) +unset( _conf_l10n ) +set( _conf_pos 0 ) +while( _conf_pos LESS ${_conf_len} ) + string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _conf_line "${_conf_template}" ) + string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _conf_template "${_conf_template}" ) + math( EXPR _conf_pos "${_conf_pos}+1" ) + if( _conf_comment ) + if( "${_conf_line}" MATCHES "^\\$\\$" OR "${_conf_line}" MATCHES "^@@" ) + unset( _conf_comment ) + set( _conf_line ");" ) + else( ) + string( REGEX REPLACE "\\\"" "\\\\\"" _conf_line "${_conf_line}" ) + string( REGEX REPLACE "^# +(.*)$" "\"\\1\\\\n\"" _conf_line "${_conf_line}" ) + endif( ) + else( ) + if( "${_conf_line}" MATCHES "^%%" AND NOT "${_conf_line}" STREQUAL "%%header" ) + set( _conf_comment 1 ) + set( _conf_line "i18n(\"${_conf_context}\"," ) + else( ) + set( _conf_line "" ) + endif( ) + endif( ) + set( _conf_l10n "${_conf_l10n}${_conf_line}\n" ) +endwhile( ) +file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/cupsd.conf.template.tde_l10n "${_conf_l10n}" ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "cupsdconf" + SOURCES "." cupsd.conf.template.tde_l10n +) diff --git a/tdestyles/CMakeL10n.txt b/tdestyles/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdestyles/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdestyles/highcontrast/CMakeL10n.txt b/tdestyles/highcontrast/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdestyles/highcontrast/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdestyles/highcontrast/config/CMakeL10n.txt b/tdestyles/highcontrast/config/CMakeL10n.txt new file mode 100644 index 000000000..be6bce50f --- /dev/null +++ b/tdestyles/highcontrast/config/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdestyle_highcontrast_config" ) diff --git a/tdestyles/plastik/CMakeL10n.txt b/tdestyles/plastik/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdestyles/plastik/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdestyles/plastik/config/CMakeL10n.txt b/tdestyles/plastik/config/CMakeL10n.txt new file mode 100644 index 000000000..03d67929a --- /dev/null +++ b/tdestyles/plastik/config/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdestyle_plastik_config" ) diff --git a/tdeui/CMakeL10n.txt b/tdeui/CMakeL10n.txt new file mode 100644 index 000000000..b585ce4af --- /dev/null +++ b/tdeui/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tdeui/colors/CMakeL10n.txt b/tdeui/colors/CMakeL10n.txt new file mode 100644 index 000000000..cc3505603 --- /dev/null +++ b/tdeui/colors/CMakeL10n.txt @@ -0,0 +1,22 @@ +##### prepare rgb.txt as C source ############### + +file( READ "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt" _colorsRC ) +string( REGEX REPLACE + "([ \t]*([0-9]+[ \t]+)([0-9]+[ \t]+)([0-9]+[ \t]+))([^ \t\n]+)(\n|$)" + "\\1/* xgettext: no-c-format */i18n(\"color\", \"\\5\");\\6" + _colorsRC ${_colorsRC} +) +string( REGEX REPLACE + "[^\n]*gr[ae]y[^\n]*(\n|$)" + "\\1" + _colorsRC ${_colorsRC} +) +file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/rgb.txt.tde_l10n" "${_colorsRC}" ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "tdelibs_colors" + SOURCES rgb.txt.tde_l10n +) |