diff options
author | Slávek Banko <[email protected]> | 2018-12-13 01:29:16 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-01-09 01:56:53 +0100 |
commit | 72ca5313ec7a9835959e0e2a8de282ecbe1ddc5c (patch) | |
tree | 626266dd3e3b9adf56dffc51c2729c5fb243c3c2 /modules/TDEL10n.cmake | |
parent | 3c409426806d9b7c15bd0142b5154b3f2f2026e3 (diff) | |
download | tde-cmake-72ca5313ec7a9835959e0e2a8de282ecbe1ddc5c.tar.gz tde-cmake-72ca5313ec7a9835959e0e2a8de282ecbe1ddc5c.zip |
Update TDEL10n module
+ Implement tde_l10n_preparetips using the tde_l10n_prepare_xml function.
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'modules/TDEL10n.cmake')
-rw-r--r-- | modules/TDEL10n.cmake | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index efc0c14..17ca1af 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -530,44 +530,12 @@ endmacro( ) macro( tde_l10n_preparetips _tips ) - if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_tips} ) - - file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_tips} _tips_html ) - string( REGEX REPLACE "[^\n]" "" _tips_len ${_tips_html} ) - string( LENGTH "+${_tips_len}" _tips_len ) - unset( _tips_inside ) - unset( _tips_l10n ) - set( _tips_pos 0 ) - while( _tips_pos LESS ${_tips_len} ) - string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _tips_line "${_tips_html}" ) - string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _tips_html "${_tips_html}" ) - math( EXPR _tips_pos "${_tips_pos}+1" ) - string( REGEX REPLACE "\\\\" "\\\\\\\\" _tips_line "${_tips_line}" ) - string( REGEX REPLACE "\\\"" "\\\\\"" _tips_line "${_tips_line}" ) - if( NOT _tips_inside ) - if( "${_tips_line}" MATCHES "<html>" ) - set( _tips_inside 1 ) - string( REGEX REPLACE ".*<html>" "" _tips_line "${_tips_line}" ) - string( REGEX REPLACE "(.+)" "\"\\1\\\\n\"" _tips_line "${_tips_line}" ) - set( _tips_line "i18n(${_tips_line}" ) - else( ) - set( _tips_line "" ) - endif( ) - else( ) - if( "${_tips_line}" MATCHES "</html>" ) - unset( _tips_inside ) - string( REGEX REPLACE "</html>.*" "" _tips_line "${_tips_line}" ) - string( REGEX REPLACE "(.+)" "\"\\1\\\\n\"" _tips_line "${_tips_line}" ) - set( _tips_line "${_tips_line});" ) - else( ) - set( _tips_line "\"${_tips_line}\\n\"" ) - endif( ) - endif( ) - set( _tips_l10n "${_tips_l10n}${_tips_line}\n" ) - endwhile( ) - file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_tips}.tde_l10n "${_tips_l10n}" ) - - endif( ) + tde_l10n_prepare_xml( + SOURCE ${_tips} + TAGS html + C_FORMAT + PRESERVE entities line-wrap spaces-leading spaces-trailing spaces-multi + ) endmacro( ) |