Update TDEL10n module

+ Fix unwanted semicolons processing within CMake.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit b88855a293)
r14.0.x
Slávek Banko 6 years ago
parent 3cfc9620c8
commit 8349b4a317
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -431,8 +431,8 @@ macro( tde_l10n_create_template )
# set charset and encoding headers # set charset and encoding headers
if( _pot ) if( _pot )
string( REPLACE "Content-Type: text/plain charset=CHARSET" "Content-Type: text/plain charset=UTF-8" _pot ${_pot} ) string( REPLACE "Content-Type: text/plain; charset=CHARSET" "Content-Type: text/plain; charset=UTF-8" _pot "${_pot}" )
string( REPLACE "Content-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _pot ${_pot} ) string( REPLACE "Content-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _pot "${_pot}" )
endif( ) endif( )
endif( ) endif( )
@ -455,8 +455,8 @@ macro( tde_l10n_create_template )
# merge translation templates # merge translation templates
if( _potDesktop ) if( _potDesktop )
if( _pot ) if( _pot )
file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ${_pot} ) file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp "${_pot}" )
file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ${_potDesktop} ) file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp "${_potDesktop}" )
execute_process( execute_process(
COMMAND ${MSGUNIQ_EXECUTABLE} --use-first COMMAND ${MSGUNIQ_EXECUTABLE} --use-first
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp
@ -465,18 +465,18 @@ macro( tde_l10n_create_template )
) )
file( REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ) file( REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp )
else( ) else( )
set( _pot ${_potDesktop} ) set( _pot "${_potDesktop}" )
# set charset and encoding headers # set charset and encoding headers
string( REPLACE "Content-Type: text/plain charset=CHARSET" "Content-Type: text/plain charset=UTF-8" _pot ${_pot} ) string( REPLACE "Content-Type: text/plain; charset=CHARSET" "Content-Type: text/plain; charset=UTF-8" _pot "${_pot}" )
string( REPLACE "Content-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _pot ${_pot} ) string( REPLACE "Content-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _pot "${_pot}" )
endif( ) endif( )
endif( ) endif( )
endif( ) endif( )
# merge additional pot files # merge additional pot files
if( _pots ) if( _pots )
file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ${_pot} ) file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp "${_pot}" )
execute_process( execute_process(
COMMAND ${MSGCAT_EXECUTABLE} --use-first extracted-pot.tmp ${_pots} COMMAND ${MSGCAT_EXECUTABLE} --use-first extracted-pot.tmp ${_pots}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@ -485,8 +485,8 @@ macro( tde_l10n_create_template )
file( REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ) file( REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp )
# set charset and encoding headers # set charset and encoding headers
string( REPLACE "Content-Type: text/plain charset=CHARSET" "Content-Type: text/plain charset=UTF-8" _pot ${_pot} ) string( REPLACE "Content-Type: text/plain; charset=CHARSET" "Content-Type: text/plain; charset=UTF-8" _pot "${_pot}" )
string( REPLACE "Content-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _pot ${_pot} ) string( REPLACE "Content-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _pot "${_pot}" )
endif( ) endif( )
# finalize translation template # finalize translation template
@ -506,14 +506,14 @@ macro( tde_l10n_create_template )
string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} ) string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} )
endif( ) endif( )
if( "${_rcLine}" MATCHES "^i18n\\(" AND _rcOrig ) if( "${_rcLine}" MATCHES "^i18n\\(" AND _rcOrig )
string( REGEX REPLACE "(^|\n)(#:.*) extracted-rc.tde_l10n:${_rcPos}( |\n)" "\\1\\2 ${_rcOrig}\\3" _pot ${_pot} ) string( REGEX REPLACE "(^|\n)(#:.*) extracted-rc.tde_l10n:${_rcPos}( |\n)" "\\1\\2 ${_rcOrig}\\3" _pot "${_pot}" )
unset( _rcOrig ) unset( _rcOrig )
endif( ) endif( )
endwhile( ) endwhile( )
endif( ) endif( )
# update references for modified source files (".tde_l10n" extension) # update references for modified source files (".tde_l10n" extension)
string( REGEX REPLACE "\\.tde_l10n(:[0-9]+)" "\\1" _pot ${_pot} ) string( REGEX REPLACE "\\.tde_l10n(:[0-9]+)" "\\1" _pot "${_pot}" )
# save translation template # save translation template
if( EXISTS "${_dest}${_catalog}.pot" ) if( EXISTS "${_dest}${_catalog}.pot" )
@ -522,11 +522,11 @@ macro( tde_l10n_create_template )
unset( _potOrig ) unset( _potOrig )
endif( ) endif( )
if( _potOrig ) if( _potOrig )
string( REGEX REPLACE "\n\"POT-Creation-Date: [^\"]*\"\n" "" _potOrig ${_potOrig} ) string( REGEX REPLACE "\n\"POT-Creation-Date: [^\"]*\"\n" "" _potOrig "${_potOrig}" )
string( REGEX REPLACE "\n\"POT-Creation-Date: [^\"]*\"\n" "" _potNew ${_pot} ) string( REGEX REPLACE "\n\"POT-Creation-Date: [^\"]*\"\n" "" _potNew "${_pot}" )
endif( ) endif( )
if( NOT _potOrig OR NOT "${_potNew}" STREQUAL "${_potOrig}" ) if( NOT _potOrig OR NOT "${_potNew}" STREQUAL "${_potOrig}" )
file( WRITE "${_dest}${_catalog}.pot" ${_pot} ) file( WRITE "${_dest}${_catalog}.pot" "${_pot}" )
endif( ) endif( )
endif( _pot ) endif( _pot )

Loading…
Cancel
Save