diff options
36 files changed, 347 insertions, 0 deletions
diff --git a/CMakeL10n.txt b/CMakeL10n.txt new file mode 100644 index 00000000..43a30ed0 --- /dev/null +++ b/CMakeL10n.txt @@ -0,0 +1,28 @@ +################################################# +# +# (C) 2018-2019 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}/../koffice-i18n/template/messages/koffice" ) + + +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/chalk/CMakeL10n.txt b/chalk/CMakeL10n.txt new file mode 100644 index 00000000..c82289f8 --- /dev/null +++ b/chalk/CMakeL10n.txt @@ -0,0 +1,112 @@ +################################################# +##### +##### from_hex( HEX DEC ) +##### + +function( from_hex HEX DEC ) + string(SUBSTRING "${HEX}" 2 -1 HEX) + string(TOUPPER "${HEX}" HEX) + set(_res 0) + string(LENGTH "${HEX}" _strlen) + + while(_strlen GREATER 0) + math(EXPR _res "${_res} * 16") + string(SUBSTRING "${HEX}" 0 1 NIBBLE) + string(SUBSTRING "${HEX}" 1 -1 HEX) + if(NIBBLE STREQUAL "A") + math(EXPR _res "${_res} + 10") + elseif(NIBBLE STREQUAL "B") + math(EXPR _res "${_res} + 11") + elseif(NIBBLE STREQUAL "C") + math(EXPR _res "${_res} + 12") + elseif(NIBBLE STREQUAL "D") + math(EXPR _res "${_res} + 13") + elseif(NIBBLE STREQUAL "E") + math(EXPR _res "${_res} + 14") + elseif(NIBBLE STREQUAL "F") + math(EXPR _res "${_res} + 15") + else() + math(EXPR _res "${_res} + ${NIBBLE}") + endif() + + string(LENGTH "${HEX}" _strlen) + endwhile() + + set(${DEC} ${_res} PARENT_SCOPE) +endfunction() + + +##### prepare strings from data files ########### + +file( GLOB_RECURSE _chalk_data_files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.ggr + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.gpl + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.gih + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.gbr + ${CMAKE_CURRENT_SOURCE_DIR}/data/*.pat +) +list( SORT _chalk_data_files ) +unset( _chalk_data_l10n ) +foreach( _chalk_file ${_chalk_data_files} ) + + if( "${_chalk_file}" MATCHES "\\.(ggr|gpl)" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} _file_data ) + string( REGEX REPLACE "(^|\n)Name: ([^\n]+).*" "\\1i18n(\"\\2\");\\n" _file_l10n "${_file_data}" ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file}.tde_l10n "${_file_l10n}" ) + endif( ) + + if( "${_chalk_file}" MATCHES "\\.gih" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} _file_data ) + string( REGEX REPLACE "^([^\n]+).*" "i18n(\"\\1\");\\n" _file_l10n "${_file_data}" ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file}.tde_l10n "${_file_l10n}" ) + endif( ) + + if( "${_chalk_file}" MATCHES "\\.gbr" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} + _file_head LIMIT 4 HEX ) + from_hex( "0x${_file_head}" _file_head_size ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} + _file_head LIMIT 4 OFFSET 4 HEX ) + from_hex( "0x${_file_head}" _file_head_version ) + if( "${_file_head_version}" EQUAL "1" ) + math( EXPR _file_head_len "${_file_head_size} - 21" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} + _file_head LIMIT ${_file_head_len} OFFSET 20 ) + else( ) + math( EXPR _file_head_len "${_file_head_size} - 29" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} + _file_head LIMIT ${_file_head_len} OFFSET 28 ) + endif( ) + string( STRIP "${_file_head}" _file_head ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file}.tde_l10n + "i18n(\"${_file_head}\");\n" ) + endif( ) + + if( "${_chalk_file}" MATCHES "\\.pat" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} + _file_head LIMIT 4 HEX ) + from_hex( "0x${_file_head}" _file_head_size ) + math( EXPR _file_head_len "${_file_head_size} - 25" ) + file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file} + _file_head LIMIT ${_file_head_len} OFFSET 24 ) + string( STRIP "${_file_head}" _file_head ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_chalk_file}.tde_l10n + "i18n(\"${_file_head}\");\n" ) + endif( ) + + list( APPEND _chalk_data_l10n "${_chalk_file}.tde_l10n" ) + +endforeach( ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "chalk" + SOURCES + ${_chalk_data_l10n} + "." +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/chalk/plugins/CMakeL10n.txt b/chalk/plugins/CMakeL10n.txt new file mode 100644 index 00000000..b585ce4a --- /dev/null +++ b/chalk/plugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/chalk/plugins/viewplugins/CMakeL10n.txt b/chalk/plugins/viewplugins/CMakeL10n.txt new file mode 100644 index 00000000..b585ce4a --- /dev/null +++ b/chalk/plugins/viewplugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/chalk/plugins/viewplugins/screenshot/CMakeL10n.txt b/chalk/plugins/viewplugins/screenshot/CMakeL10n.txt new file mode 100644 index 00000000..32852c1a --- /dev/null +++ b/chalk/plugins/viewplugins/screenshot/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kscreenshot_plugin" ) diff --git a/example/CMakeL10n.txt b/example/CMakeL10n.txt new file mode 100644 index 00000000..071915c1 --- /dev/null +++ b/example/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "example" ) diff --git a/filters/CMakeL10n.txt b/filters/CMakeL10n.txt new file mode 100644 index 00000000..eea0b16b --- /dev/null +++ b/filters/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kofficefilters" ) diff --git a/karbon/CMakeL10n.txt b/karbon/CMakeL10n.txt new file mode 100644 index 00000000..1e6f6387 --- /dev/null +++ b/karbon/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "karbon" ) diff --git a/kchart/CMakeL10n.txt b/kchart/CMakeL10n.txt new file mode 100644 index 00000000..31cfc34d --- /dev/null +++ b/kchart/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kchart" ) diff --git a/kexi/CMakeL10n.txt b/kexi/CMakeL10n.txt new file mode 100644 index 00000000..b060940d --- /dev/null +++ b/kexi/CMakeL10n.txt @@ -0,0 +1,14 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kexi" + EXCLUDES + "^3rdparty/" + "^doc/" + "^formeditor/" + "^plugins/scripting/" + "^scriptingplugins/" + "(^|/)tests/" +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/kexi/formeditor/CMakeL10n.txt b/kexi/formeditor/CMakeL10n.txt new file mode 100644 index 00000000..52636a3a --- /dev/null +++ b/kexi/formeditor/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kformdesigner" ) diff --git a/kformula/CMakeL10n.txt b/kformula/CMakeL10n.txt new file mode 100644 index 00000000..d84f3c5c --- /dev/null +++ b/kformula/CMakeL10n.txt @@ -0,0 +1,6 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kformula" + SOURCES "." "tips" +) diff --git a/kivio/CMakeL10n.txt b/kivio/CMakeL10n.txt new file mode 100644 index 00000000..4ccb2a6b --- /dev/null +++ b/kivio/CMakeL10n.txt @@ -0,0 +1,29 @@ +##### prepare strings from data files ########### + +unset( _kivio_data_l10n ) +file( GLOB_RECURSE _kivio_data_files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.shape +) +list( SORT _kivio_data_files ) +foreach( _kivio_file ${_kivio_data_files} ) + tde_l10n_prepare_xml( + SOURCE "${_kivio_file}" + CONTEXT "Stencils" + TAGS "name" + ) + list( APPEND _kivio_data_l10n "${_kivio_file}.tde_l10n" ) +endforeach( ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kivio" + SOURCES + "." + ${_kivio_data_l10n} + ATTRIBUTES + "desc:Title,data,Stencils:Description,data,Stencils" + "*.sml:Title,data,Stencils:Description,data,Stencils" +) diff --git a/koshell/CMakeL10n.txt b/koshell/CMakeL10n.txt new file mode 100644 index 00000000..f16789bd --- /dev/null +++ b/koshell/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "koshell" ) diff --git a/kounavail/CMakeL10n.txt b/kounavail/CMakeL10n.txt new file mode 100644 index 00000000..cc303a02 --- /dev/null +++ b/kounavail/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kounavail" ) diff --git a/kplato/CMakeL10n.txt b/kplato/CMakeL10n.txt new file mode 100644 index 00000000..be1e17dc --- /dev/null +++ b/kplato/CMakeL10n.txt @@ -0,0 +1,10 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kplato" + SOURCES + "." + "../kdgantt" + ATTRIBUTES + "reports/*.ktf:Label,Text" +) diff --git a/kpresenter/CMakeL10n.txt b/kpresenter/CMakeL10n.txt new file mode 100644 index 00000000..6779b88e --- /dev/null +++ b/kpresenter/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kpresenter" ) diff --git a/kspread/CMakeL10n.txt b/kspread/CMakeL10n.txt new file mode 100644 index 00000000..c53d930f --- /dev/null +++ b/kspread/CMakeL10n.txt @@ -0,0 +1,29 @@ +##### prepare strings from data files ########### + +file( GLOB_RECURSE _kspread_data_files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/extensions/*.xml +) +list( SORT _kspread_data_files ) +unset( _kspread_data_l10n ) +foreach( _kspread_file ${_kspread_data_files} ) + tde_l10n_prepare_xml( + SOURCE ${_kspread_file} + TAGS "Example" "GroupName" "Text" "Comment" "Syntax" "TypeName" + ) + list( APPEND _kspread_data_l10n "${_kspread_file}.tde_l10n" ) +endforeach( ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kspread" + SOURCES + "." + ${_kspread_data_l10n} + EXCLUDES + "^plugins/" +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/kspread/plugins/CMakeL10n.txt b/kspread/plugins/CMakeL10n.txt new file mode 100644 index 00000000..b585ce4a --- /dev/null +++ b/kspread/plugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/kspread/plugins/calculator/CMakeL10n.txt b/kspread/plugins/calculator/CMakeL10n.txt new file mode 100644 index 00000000..d93fae61 --- /dev/null +++ b/kspread/plugins/calculator/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kspreadcalc_calc" ) diff --git a/kspread/plugins/insertcalendar/CMakeL10n.txt b/kspread/plugins/insertcalendar/CMakeL10n.txt new file mode 100644 index 00000000..a906118b --- /dev/null +++ b/kspread/plugins/insertcalendar/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kspreadinsertcalendar" ) diff --git a/kugar/CMakeL10n.txt b/kugar/CMakeL10n.txt new file mode 100644 index 00000000..42b3d1b3 --- /dev/null +++ b/kugar/CMakeL10n.txt @@ -0,0 +1,6 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kugar" + KEYWORDS "tr" "tqtr" +) diff --git a/kword/CMakeL10n.txt b/kword/CMakeL10n.txt new file mode 100644 index 00000000..59396ccb --- /dev/null +++ b/kword/CMakeL10n.txt @@ -0,0 +1,27 @@ +##### prepare strings from data files ########### + +file( GLOB_RECURSE _kword_data_files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/expression/*.xml +) +list( SORT _kword_data_files ) +unset( _kword_data_l10n ) +foreach( _kword_file ${_kword_data_files} ) + tde_l10n_prepare_xml( + SOURCE ${_kword_file} + TAGS "Example" "GroupName" "Text" "Comment" "Syntax" "TypeName" + ) + list( APPEND _kword_data_l10n "${_kword_file}.tde_l10n" ) +endforeach( ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "kword" + SOURCES + "." + ${_kword_data_l10n} +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/lib/CMakeL10n.txt b/lib/CMakeL10n.txt new file mode 100644 index 00000000..5a155def --- /dev/null +++ b/lib/CMakeL10n.txt @@ -0,0 +1,8 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "koffice" + EXCLUDES "^koproperty/" +) + +tde_l10n_auto_add_subdirectories( ) diff --git a/lib/koproperty/CMakeL10n.txt b/lib/koproperty/CMakeL10n.txt new file mode 100644 index 00000000..e9902353 --- /dev/null +++ b/lib/koproperty/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "koproperty" ) diff --git a/plugins/CMakeL10n.txt b/plugins/CMakeL10n.txt new file mode 100644 index 00000000..b585ce4a --- /dev/null +++ b/plugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/plugins/scan/CMakeL10n.txt b/plugins/scan/CMakeL10n.txt new file mode 100644 index 00000000..a389d0ca --- /dev/null +++ b/plugins/scan/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kscan_plugin" ) diff --git a/tools/CMakeL10n.txt b/tools/CMakeL10n.txt new file mode 100644 index 00000000..b585ce4a --- /dev/null +++ b/tools/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tools/converter/CMakeL10n.txt b/tools/converter/CMakeL10n.txt new file mode 100644 index 00000000..cbf81010 --- /dev/null +++ b/tools/converter/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "koconverter" ) diff --git a/tools/kthesaurus/CMakeL10n.txt b/tools/kthesaurus/CMakeL10n.txt new file mode 100644 index 00000000..83f72052 --- /dev/null +++ b/tools/kthesaurus/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "kthesaurus" ) diff --git a/tools/tdefile-plugins/CMakeL10n.txt b/tools/tdefile-plugins/CMakeL10n.txt new file mode 100644 index 00000000..b585ce4a --- /dev/null +++ b/tools/tdefile-plugins/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_auto_add_subdirectories( ) diff --git a/tools/tdefile-plugins/abiword/CMakeL10n.txt b/tools/tdefile-plugins/abiword/CMakeL10n.txt new file mode 100644 index 00000000..8527aa80 --- /dev/null +++ b/tools/tdefile-plugins/abiword/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdefile_abiword" ) diff --git a/tools/tdefile-plugins/gnumeric/CMakeL10n.txt b/tools/tdefile-plugins/gnumeric/CMakeL10n.txt new file mode 100644 index 00000000..2279d7c4 --- /dev/null +++ b/tools/tdefile-plugins/gnumeric/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdefile_gnumeric" ) diff --git a/tools/tdefile-plugins/koffice/CMakeL10n.txt b/tools/tdefile-plugins/koffice/CMakeL10n.txt new file mode 100644 index 00000000..dd32cc0c --- /dev/null +++ b/tools/tdefile-plugins/koffice/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdefile_koffice" ) diff --git a/tools/tdefile-plugins/ooo/CMakeL10n.txt b/tools/tdefile-plugins/ooo/CMakeL10n.txt new file mode 100644 index 00000000..d27456ea --- /dev/null +++ b/tools/tdefile-plugins/ooo/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "tdefile_ooo" ) diff --git a/tools/thesaurus/CMakeL10n.txt b/tools/thesaurus/CMakeL10n.txt new file mode 100644 index 00000000..ba844e61 --- /dev/null +++ b/tools/thesaurus/CMakeL10n.txt @@ -0,0 +1,3 @@ +##### create translation templates ############## + +tde_l10n_create_template( "thesaurus_tool" ) |