summaryrefslogtreecommitdiffstats
path: root/tdeprint
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-02 16:47:00 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-12-09 16:42:46 +0100
commita07b08c92d7a3ae296aa6c20ef3c19aeb6020fb3 (patch)
tree253e9aa525c0179a9739afc036f619d25cf6f023 /tdeprint
parent9a06da7515ae1a6b3975e2ff001f2d5de6e04762 (diff)
downloadtdelibs-a07b08c92d7a3ae296aa6c20ef3c19aeb6020fb3.tar.gz
tdelibs-a07b08c92d7a3ae296aa6c20ef3c19aeb6020fb3.zip
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 707d60c602a5bed23be354ea362ea7c24a87fb0b)
Diffstat (limited to 'tdeprint')
-rw-r--r--tdeprint/CMakeL10n.txt8
-rw-r--r--tdeprint/cups/CMakeL10n.txt3
-rw-r--r--tdeprint/cups/cupsdconf2/CMakeL10n.txt40
3 files changed, 51 insertions, 0 deletions
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
+)