|
|
|
@ -1636,6 +1636,7 @@ endmacro( )
|
|
|
|
|
##### tde_create_translated_desktop(
|
|
|
|
|
##### [SOURCE] file_name
|
|
|
|
|
##### [KEYWORDS keyword [keyword]]
|
|
|
|
|
##### [FORMAT (desktop|xml)]
|
|
|
|
|
##### [PO_DIR po_directory]
|
|
|
|
|
##### [DESTINATION directory]
|
|
|
|
|
##### [OUTPUT_NAME file_name]
|
|
|
|
@ -1653,6 +1654,7 @@ macro( tde_create_translated_desktop )
|
|
|
|
|
set( _keywords_desktop_default
|
|
|
|
|
"Name" "GenericName" "Comment" "Keywords"
|
|
|
|
|
"Description" "ExtraNames" "X-TDE-Submenu" )
|
|
|
|
|
set( _format "desktop" )
|
|
|
|
|
|
|
|
|
|
foreach( _arg ${ARGN} )
|
|
|
|
|
|
|
|
|
@ -1670,6 +1672,13 @@ macro( tde_create_translated_desktop )
|
|
|
|
|
set( _directive 1 )
|
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
# found directive "FORMAT"
|
|
|
|
|
if( "+${_arg}" STREQUAL "+FORMAT" )
|
|
|
|
|
unset( _format )
|
|
|
|
|
set( _var _format )
|
|
|
|
|
set( _directive 1 )
|
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
# found directive "PO_DIR"
|
|
|
|
|
if( "+${_arg}" STREQUAL "+PO_DIR" )
|
|
|
|
|
unset( _arg_po_dir )
|
|
|
|
@ -1885,17 +1894,28 @@ macro( tde_create_translated_desktop )
|
|
|
|
|
string( REPLACE ";" "|" _keywords_match "(${_keywords_desktop})" )
|
|
|
|
|
|
|
|
|
|
# merge translations command
|
|
|
|
|
add_custom_command(
|
|
|
|
|
OUTPUT ${_basename}${_binsuffix}
|
|
|
|
|
COMMAND ${PERL_EXECUTABLE} -p -e "'s/^${_keywords_match}[ ]*=[ ]*/_\\1=/'" < ${_src} > ${_basename}.in
|
|
|
|
|
COMMAND ${PERL_EXECUTABLE} ${INTLTOOL_MERGE_EXECUTABLE} -q -d ${_po_dir} ${_basename}.in ${_basename}${_binsuffix}
|
|
|
|
|
DEPENDS ${_src}
|
|
|
|
|
COMMENT "Merging translations into ${_sourcename}"
|
|
|
|
|
)
|
|
|
|
|
if( _format STREQUAL "desktop" )
|
|
|
|
|
add_custom_command(
|
|
|
|
|
OUTPUT ${_basename}${_binsuffix}
|
|
|
|
|
COMMAND ${PERL_EXECUTABLE} -p -e "'s/^${_keywords_match}[ ]*=[ ]*/_\\1=/'" < ${_src} > ${_basename}.in
|
|
|
|
|
COMMAND ${PERL_EXECUTABLE} ${INTLTOOL_MERGE_EXECUTABLE} -q -d ${_po_dir} ${_basename}.in ${_basename}${_binsuffix}
|
|
|
|
|
DEPENDS ${_src}
|
|
|
|
|
COMMENT "Merging translations into ${_sourcename}"
|
|
|
|
|
)
|
|
|
|
|
elseif( _format STREQUAL "xml" )
|
|
|
|
|
add_custom_command(
|
|
|
|
|
OUTPUT ${_basename}${_binsuffix}
|
|
|
|
|
COMMAND ${PERL_EXECUTABLE} -p -e "'s/(<\\/?)${_keywords_match}([ >])/\\1_\\2\\3/g'" < ${_src} > ${_basename}.in
|
|
|
|
|
COMMAND ${PERL_EXECUTABLE} ${INTLTOOL_MERGE_EXECUTABLE} -q -x ${_po_dir} ${_basename}.in ${_basename}${_binsuffix}
|
|
|
|
|
DEPENDS ${_src}
|
|
|
|
|
COMMENT "Merging translations into ${_sourcename}"
|
|
|
|
|
)
|
|
|
|
|
else()
|
|
|
|
|
tde_message_fatal( "Unknown file format for merging translations." )
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
# merge translations target
|
|
|
|
|
|
|
|
|
|
else( )
|
|
|
|
|
|
|
|
|
@ -1909,6 +1929,7 @@ macro( tde_create_translated_desktop )
|
|
|
|
|
|
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
# merge translations target
|
|
|
|
|
add_custom_target( "${_target}" ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_basename}${_binsuffix} )
|
|
|
|
|
|
|
|
|
|
endif( )
|
|
|
|
|