Browse Source

Add CMakeL10n rules.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 60f97e3b91)
tags/r14.0.6
Slávek Banko 10 months ago
parent
commit
8147f97196
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
36 changed files with 347 additions and 0 deletions
  1. +28
    -0
      CMakeL10n.txt
  2. +112
    -0
      chalk/CMakeL10n.txt
  3. +3
    -0
      chalk/plugins/CMakeL10n.txt
  4. +3
    -0
      chalk/plugins/viewplugins/CMakeL10n.txt
  5. +3
    -0
      chalk/plugins/viewplugins/screenshot/CMakeL10n.txt
  6. +3
    -0
      example/CMakeL10n.txt
  7. +3
    -0
      filters/CMakeL10n.txt
  8. +3
    -0
      karbon/CMakeL10n.txt
  9. +3
    -0
      kchart/CMakeL10n.txt
  10. +14
    -0
      kexi/CMakeL10n.txt
  11. +3
    -0
      kexi/formeditor/CMakeL10n.txt
  12. +6
    -0
      kformula/CMakeL10n.txt
  13. +29
    -0
      kivio/CMakeL10n.txt
  14. +3
    -0
      koshell/CMakeL10n.txt
  15. +3
    -0
      kounavail/CMakeL10n.txt
  16. +10
    -0
      kplato/CMakeL10n.txt
  17. +3
    -0
      kpresenter/CMakeL10n.txt
  18. +29
    -0
      kspread/CMakeL10n.txt
  19. +3
    -0
      kspread/plugins/CMakeL10n.txt
  20. +3
    -0
      kspread/plugins/calculator/CMakeL10n.txt
  21. +3
    -0
      kspread/plugins/insertcalendar/CMakeL10n.txt
  22. +6
    -0
      kugar/CMakeL10n.txt
  23. +27
    -0
      kword/CMakeL10n.txt
  24. +8
    -0
      lib/CMakeL10n.txt
  25. +3
    -0
      lib/koproperty/CMakeL10n.txt
  26. +3
    -0
      plugins/CMakeL10n.txt
  27. +3
    -0
      plugins/scan/CMakeL10n.txt
  28. +3
    -0
      tools/CMakeL10n.txt
  29. +3
    -0
      tools/converter/CMakeL10n.txt
  30. +3
    -0
      tools/kthesaurus/CMakeL10n.txt
  31. +3
    -0
      tools/tdefile-plugins/CMakeL10n.txt
  32. +3
    -0
      tools/tdefile-plugins/abiword/CMakeL10n.txt
  33. +3
    -0
      tools/tdefile-plugins/gnumeric/CMakeL10n.txt
  34. +3
    -0
      tools/tdefile-plugins/koffice/CMakeL10n.txt
  35. +3
    -0
      tools/tdefile-plugins/ooo/CMakeL10n.txt
  36. +3
    -0
      tools/thesaurus/CMakeL10n.txt

+ 28
- 0
CMakeL10n.txt View File

@@ -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( )

+ 112
- 0
chalk/CMakeL10n.txt View File

@@ -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( )

+ 3
- 0
chalk/plugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
chalk/plugins/viewplugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
chalk/plugins/viewplugins/screenshot/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kscreenshot_plugin" )

+ 3
- 0
example/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "example" )

+ 3
- 0
filters/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kofficefilters" )

+ 3
- 0
karbon/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "karbon" )

+ 3
- 0
kchart/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kchart" )

+ 14
- 0
kexi/CMakeL10n.txt View File

@@ -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( )

+ 3
- 0
kexi/formeditor/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kformdesigner" )

+ 6
- 0
kformula/CMakeL10n.txt View File

@@ -0,0 +1,6 @@
##### create translation templates ##############

tde_l10n_create_template(
CATALOG "kformula"
SOURCES "." "tips"
)

+ 29
- 0
kivio/CMakeL10n.txt View File

@@ -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"
)

+ 3
- 0
koshell/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "koshell" )

+ 3
- 0
kounavail/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kounavail" )

+ 10
- 0
kplato/CMakeL10n.txt View File

@@ -0,0 +1,10 @@
##### create translation templates ##############

tde_l10n_create_template(
CATALOG "kplato"
SOURCES
"."
"../kdgantt"
ATTRIBUTES
"reports/*.ktf:Label,Text"
)

+ 3
- 0
kpresenter/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kpresenter" )

+ 29
- 0
kspread/CMakeL10n.txt View File

@@ -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( )

+ 3
- 0
kspread/plugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
kspread/plugins/calculator/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kspreadcalc_calc" )

+ 3
- 0
kspread/plugins/insertcalendar/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kspreadinsertcalendar" )

+ 6
- 0
kugar/CMakeL10n.txt View File

@@ -0,0 +1,6 @@
##### create translation templates ##############

tde_l10n_create_template(
CATALOG "kugar"
KEYWORDS "tr" "tqtr"
)

+ 27
- 0
kword/CMakeL10n.txt View File

@@ -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( )

+ 8
- 0
lib/CMakeL10n.txt View File

@@ -0,0 +1,8 @@
##### create translation templates ##############

tde_l10n_create_template(
CATALOG "koffice"
EXCLUDES "^koproperty/"
)

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
lib/koproperty/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "koproperty" )

+ 3
- 0
plugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
plugins/scan/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kscan_plugin" )

+ 3
- 0
tools/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tools/converter/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "koconverter" )

+ 3
- 0
tools/kthesaurus/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "kthesaurus" )

+ 3
- 0
tools/tdefile-plugins/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_auto_add_subdirectories( )

+ 3
- 0
tools/tdefile-plugins/abiword/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "tdefile_abiword" )

+ 3
- 0
tools/tdefile-plugins/gnumeric/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "tdefile_gnumeric" )

+ 3
- 0
tools/tdefile-plugins/koffice/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "tdefile_koffice" )

+ 3
- 0
tools/tdefile-plugins/ooo/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "tdefile_ooo" )

+ 3
- 0
tools/thesaurus/CMakeL10n.txt View File

@@ -0,0 +1,3 @@
##### create translation templates ##############

tde_l10n_create_template( "thesaurus_tool" )

Loading…
Cancel
Save