diff --git a/share/qt/translate.cmake b/share/qt/translate.cmake index cc5035267b7..a4eeef96038 100644 --- a/share/qt/translate.cmake +++ b/share/qt/translate.cmake @@ -8,7 +8,6 @@ set(input_variables LCONVERT_EXECUTABLE LUPDATE_EXECUTABLE PYTHON_EXECUTABLE - SED_EXECUTABLE XGETTEXT_EXECUTABLE ) @@ -73,13 +72,11 @@ execute_process( COMMAND_ERROR_IS_FATAL ANY ) -execute_process( - COMMAND ${SED_EXECUTABLE} - -i.old - -e "s|source-language=\"en\" target-language=\"en\"|source-language=\"en\"|" - -e "/<\\/target>/d" - ${PROJECT_SOURCE_DIR}/src/qt/locale/bitcoin_en.xlf - COMMAND_ERROR_IS_FATAL ANY +file(READ "${PROJECT_SOURCE_DIR}/src/qt/locale/bitcoin_en.xlf" bitcoin_en) +string(REPLACE "source-language=\"en\" target-language=\"en\"" + "source-language=\"en\"" bitcoin_en "${bitcoin_en}" ) - -file(REMOVE "${PROJECT_SOURCE_DIR}/src/qt/locale/bitcoin_en.xlf.old") +string(REGEX REPLACE " *\n" + "" bitcoin_en "${bitcoin_en}" +) +file(WRITE "${PROJECT_SOURCE_DIR}/src/qt/locale/bitcoin_en.xlf" "${bitcoin_en}") diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index c3113067d6f..5a3f98738f6 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -290,15 +290,10 @@ if(BUILD_GUI_TESTS) endif() find_program(XGETTEXT_EXECUTABLE xgettext) -find_program(SED_EXECUTABLE sed) if(NOT XGETTEXT_EXECUTABLE) add_custom_target(translate COMMAND ${CMAKE_COMMAND} -E echo "Error: GNU gettext-tools not found" ) -elseif(NOT SED_EXECUTABLE) - add_custom_target(translate - COMMAND ${CMAKE_COMMAND} -E echo "Error: GNU sed not found" - ) else() add_custom_target(translate COMMAND ${CMAKE_COMMAND} -D "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" @@ -306,7 +301,6 @@ else() -D "LCONVERT_EXECUTABLE=$" -D "LUPDATE_EXECUTABLE=$" -D "PYTHON_EXECUTABLE=$" - -D "SED_EXECUTABLE=${SED_EXECUTABLE}" -D "XGETTEXT_EXECUTABLE=${XGETTEXT_EXECUTABLE}" -P ${PROJECT_SOURCE_DIR}/share/qt/translate.cmake )