TDE core libraries
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #################################################
  2. #
  3. # (C) 2018 Slávek Banko
  4. # slavek.banko (AT) axis.cz
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. cmake_minimum_required( VERSION 2.8 )
  12. ##### include our cmake modules #################
  13. set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
  14. include( TDEL10n )
  15. ##### set directory for POT files ###############
  16. set( POT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../tde-i18n/template/messages/tdelibs" )
  17. ##### verify tqt3 sources #######################
  18. if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src )
  19. tde_message_fatal( "TQt3 source code is required but not found" )
  20. endif( )
  21. ##### prepare tqt3/src/xml/qxml.cpp #############
  22. if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp )
  23. # hide "#define" to allow strings to be extracted using xgettext
  24. file( READ ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp _tqt_qxml )
  25. string( REGEX REPLACE "\n(#define[^\n]*)(QT_TRANSLATE_NOOP)" "\n/*\\1*/\\2" _tqt_qxml ${_tqt_qxml} )
  26. file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n "${_tqt_qxml}" )
  27. endif( )
  28. ##### prepare tdeabc/addressee strings ##########
  29. # read file
  30. file( READ "${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/scripts/entrylist" _addressee_data )
  31. string( REGEX REPLACE "[^\n]" "" _addressee_len ${_addressee_data} )
  32. string( LENGTH "+${_addressee_len}" _addressee_len )
  33. # process lines
  34. set( _addressee_pos 0 )
  35. unset( _addressee_l10n )
  36. while( _addressee_pos LESS ${_addressee_len} )
  37. # pick line
  38. string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _addressee_line "${_addressee_data}" )
  39. string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _addressee_data "${_addressee_data}" )
  40. math( EXPR _addressee_pos "${_addressee_pos}+1" )
  41. if( "${_addressee_line}" MATCHES "^ *$" OR "${_addressee_line}" MATCHES "^ *#" )
  42. set( _addressee_line "" )
  43. else( )
  44. string( REGEX REPLACE "^[^,]*,([^,]*),([^,]*),.*" "\\1" _addressee_field "${_addressee_line}" )
  45. string( REGEX REPLACE "^[^,]*,([^,]*),([^,]*),.*" "\\2" _addressee_comment "${_addressee_line}" )
  46. if( NOT "${_addressee_field}" STREQUAL "" )
  47. string( REGEX REPLACE "[_ ]+" ";" _addressee_field ${_addressee_field} )
  48. unset( _addressee_field_name )
  49. foreach( _addressee_field_part ${_addressee_field} )
  50. string( SUBSTRING ${_addressee_field_part} 0 1 _addressee_field_first )
  51. string( SUBSTRING ${_addressee_field_part} 1 -1 _addressee_field_rest )
  52. string( TOUPPER ${_addressee_field_first} _addressee_field_first )
  53. set( _addressee_field_name "${_addressee_field_name}${_addressee_field_first}${_addressee_field_rest} " )
  54. endforeach( )
  55. string( STRIP ${_addressee_field_name} _addressee_field_name )
  56. if( NOT "${_addressee_comment}" STREQUAL "" )
  57. set( _addressee_line "i18n(\"${_addressee_comment}\", \"${_addressee_field_name}\");" )
  58. else( )
  59. set( _addressee_line "i18n(\"${_addressee_field_name}\");" )
  60. endif( )
  61. else( )
  62. set( _addressee_line "" )
  63. endif( )
  64. endif( )
  65. set( _addressee_l10n "${_addressee_l10n}${_addressee_line}\n" )
  66. endwhile( )
  67. # write file
  68. file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/scripts/entrylist.tde_l10n" "${_addressee_l10n}" )
  69. ##### create translation templates ##############
  70. tde_l10n_create_template(
  71. CATALOG "tde"
  72. SOURCES "common_texts.cpp"
  73. EXCLUDES "_translatorinfo"
  74. X-POT -
  75. DESTINATION "."
  76. )
  77. tde_l10n_create_template(
  78. CATALOG "tdelibs"
  79. SOURCES
  80. "."
  81. "tdeabc/scripts/entrylist.tde_l10n"
  82. "tdecore/tde-config.cpp.cmake"
  83. "../dependencies/tqt3/src"
  84. "../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n"
  85. EXCLUDES
  86. "/test/" "/tests/"
  87. "^arts/kde/mcop-dcop/"
  88. "^arts/knotify/"
  89. "^interfaces/tdemediaplayer/tdefileaudiopreview/"
  90. "^kate/"
  91. "^kdoctools/"
  92. "^libtdescreensaver/"
  93. "^tdeabc/formats/"
  94. "^tdeabc/plugins/"
  95. "^tdecmshell/"
  96. "^tdecore/tdeconfig_compiler/example/"
  97. "^tdeio/"
  98. "^tdeioslave/"
  99. "^tdeprint/"
  100. "^tdeui/colors/"
  101. "^tdestyles/.*/config/"
  102. "/dependencies/tqt3/src/xml/qxml.cpp$"
  103. KEYWORDS
  104. tr tr:1,2
  105. translate translate:1,2
  106. QT_TRANSLATE_NOOP QT_TRANSLATE_NOOP:1,2
  107. X-POT "-"
  108. )
  109. ##### create translation templates ##############
  110. tde_l10n_auto_add_subdirectories( )