From b88855a2934b96a2af767d1cecfae5ca66641fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 10 Dec 2018 03:15:20 +0100 Subject: [PATCH] Update TDEL10n module + Fix unwanted semicolons processing within CMake. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- modules/TDEL10n.cmake | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index 8c2caf8..503f883 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -431,8 +431,8 @@ macro( tde_l10n_create_template ) # set charset and encoding headers if( _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-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}" ) endif( ) endif( ) @@ -455,8 +455,8 @@ macro( tde_l10n_create_template ) # merge translation templates if( _potDesktop ) if( _pot ) - file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ${_pot} ) - file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ${_potDesktop} ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp "${_pot}" ) + file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp "${_potDesktop}" ) execute_process( COMMAND ${MSGUNIQ_EXECUTABLE} --use-first 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 ) else( ) - set( _pot ${_potDesktop} ) + set( _pot "${_potDesktop}" ) # 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-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _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}" ) endif( ) endif( ) endif( ) # merge additional pot files if( _pots ) - file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ${_pot} ) + file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp "${_pot}" ) execute_process( COMMAND ${MSGCAT_EXECUTABLE} --use-first extracted-pot.tmp ${_pots} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -485,8 +485,8 @@ macro( tde_l10n_create_template ) file( REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-pot.tmp ) # 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-Transfer-Encoding: ENCODING" "Content-Transfer-Encoding: 8bit" _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}" ) endif( ) # finalize translation template @@ -506,14 +506,14 @@ macro( tde_l10n_create_template ) string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} ) endif( ) 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 ) endif( ) endwhile( ) endif( ) # 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 if( EXISTS "${_dest}${_catalog}.pot" ) @@ -522,11 +522,11 @@ macro( tde_l10n_create_template ) unset( _potOrig ) endif( ) if( _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" "" _potOrig "${_potOrig}" ) + string( REGEX REPLACE "\n\"POT-Creation-Date: [^\"]*\"\n" "" _potNew "${_pot}" ) endif( ) if( NOT _potOrig OR NOT "${_potNew}" STREQUAL "${_potOrig}" ) - file( WRITE "${_dest}${_catalog}.pot" ${_pot} ) + file( WRITE "${_dest}${_catalog}.pot" "${_pot}" ) endif( ) endif( _pot )