@ -688,6 +688,7 @@ function( tde_l10n_prepare_xml )
unset ( _source )
unset ( _target )
unset ( _context )
set ( _skip_properties "database|associations|populationText" )
set ( _tags "[tT][eE][xX][tT]|title|string|whatsthis|tooltip|label" )
set ( _preserve "line-wrap" "lines-leading" "spaces-leading" "spaces-trailing" "spaces-multi" )
set ( _no_c_format 1 )
@ -717,6 +718,13 @@ function( tde_l10n_prepare_xml )
set ( _directive 1 )
endif ( )
# f o u n d d i r e c t i v e " S K I P - P R O P E R T I E S "
if ( "+${_arg}" STREQUAL "+SKIP-PROPERTIES" )
unset ( _skip_properties )
set ( _var _skip_properties )
set ( _directive 1 )
endif ( )
# f o u n d d i r e c t i v e " T A G S "
if ( "+${_arg}" STREQUAL "+TAGS" )
unset ( _tags )
@ -768,6 +776,13 @@ function( tde_l10n_prepare_xml )
# p r e p a r e t a g s t o r e g e x p
string ( REPLACE ";" "|" _tags "${_tags}" )
if ( "${_skip_properties}" STREQUAL "-" )
unset ( _skip_properties )
endif ( )
if ( DEFINED _skip_properties )
string ( REPLACE ";" "|" _skip_properties "${_skip_properties}" )
set ( _tags "property|${_tags}" )
endif ( )
# r e a d f i l e
file ( READ ${ _source } _xml_data )
@ -779,6 +794,7 @@ function( tde_l10n_prepare_xml )
unset ( _xml_l10n )
unset ( _xml_inside )
unset ( _xml_tag_empty )
unset ( _xml_skipped_prop )
while ( _xml_pos LESS ${ _xml_len } )
# p i c k l i n e
string ( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _xml_line "${_xml_data}" )
@ -793,23 +809,36 @@ function( tde_l10n_prepare_xml )
unset ( _xml_line_suffix )
unset ( _xml_line_rest )
if ( NOT _xml_inside )
if ( "${_xml_line}" MATCHES "<(${_tags})[^>]*>" )
set ( _xml_inside 1 )
set ( _xml_context "${_context}" )
string ( REGEX MATCH "<(${_tags})[^>]*>(.*)" _xml_line "${_xml_line}" )
string ( REGEX MATCH "^<(${_tags})( [^>]*)+>" _xml_attr "${_xml_line}" )
if ( _xml_attr AND "${_xml_attr}" MATCHES " context=\" ( [^\ "]*)\" " )
string ( REGEX REPLACE ".* context=\" ( [^\ "]*)\" .* " " \\1" _xml_context "${_xml_attr}" )
endif ( )
string ( REGEX REPLACE "^<(${_tags})[^>]*>(.*)" "\\2" _xml_line "${_xml_line}" )
set ( _xml_line_prefix "i18n(" )
if ( _no_c_format )
set ( _xml_line_prefix "${_xml_line_prefix}/* xgettext: no-c-format */" )
endif ( )
if ( _xml_context )
set ( _xml_line_prefix "${_xml_line_prefix}\" ${ _xml_context } \", " )
if ( _xml_skipped_prop AND "${_xml_line}" MATCHES "</property>" )
unset ( _xml_skipped_prop )
string ( REGEX MATCH "</property>(.*)" _xml_line "${_xml_line}" )
string ( REGEX REPLACE "^</property>(.*)" "\\1" _xml_line "${_xml_line}" )
endif ( )
if ( NOT _xml_skipped_prop AND "${_xml_line}" MATCHES "<(${_tags})([ \t][^>]*)*>" )
string ( REGEX MATCH "<(${_tags})([ \t][^>]*)*>(.*)" _xml_line "${_xml_line}" )
string ( REGEX MATCH "^<(${_tags})([ \t][^>]*)*>" _xml_attr "${_xml_line}" )
string ( REGEX REPLACE "^<(${_tags})([ \t][^>]*)*>(.*)" "\\3" _xml_line "${_xml_line}" )
if ( "${_xml_attr}" MATCHES "^<property([ \t][^>]*)*>" AND DEFINED _skip_properties )
if ( "${_xml_attr}" MATCHES "[ \t]name=\" ( ${ _skip_properties } ) \"" )
set ( _xml_skipped_prop 1 )
endif ( )
set ( _xml_line_rest "${_xml_line}" )
set ( _xml_line "" )
else ( )
set ( _xml_inside 1 )
set ( _xml_context "${_context}" )
if ( "${_xml_attr}" MATCHES "[ \t]context=\" ( [^\ "]*)\" " )
string ( REGEX REPLACE ".* context=\" ( [^\ "]*)\" .* " " \\1" _xml_context "${_xml_attr}" )
endif ( )
set ( _xml_line_prefix "i18n(" )
if ( _no_c_format )
set ( _xml_line_prefix "${_xml_line_prefix}/* xgettext: no-c-format */" )
endif ( )
if ( _xml_context )
set ( _xml_line_prefix "${_xml_line_prefix}\" ${ _xml_context } \", " )
endif ( )
set ( _xml_tag_empty 1 )
endif ( )
set ( _xml_tag_empty 1 )
else ( )
set ( _xml_line "" )
endif ( )