mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-03 15:43:09 +00:00
Use Qt5Translations to deal with translations
And remove the old code that did the same thing in a very complex way. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a56c0f227d
commit
1a662df648
1 changed files with 3 additions and 15 deletions
|
@ -55,7 +55,7 @@ ENDIF()
|
||||||
|
|
||||||
#configure Qt.
|
#configure Qt.
|
||||||
|
|
||||||
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network WebKitWidgets PrintSupport Svg Test)
|
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Concurrent Widgets Network WebKitWidgets PrintSupport Svg Test LinguistTools)
|
||||||
SET(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::WebKitWidgets Qt5::PrintSupport Qt5::Svg)
|
SET(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::WebKitWidgets Qt5::PrintSupport Qt5::Svg)
|
||||||
SET(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
|
SET(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test)
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ set(DOCFILES
|
||||||
${CMAKE_BINARY_DIR}/Documentation/user-manual_ru.html
|
${CMAKE_BINARY_DIR}/Documentation/user-manual_ru.html
|
||||||
)
|
)
|
||||||
|
|
||||||
set(TRANSLATION_SRC
|
QT5_ADD_TRANSLATION(TRANSLATIONS
|
||||||
translations/subsurface_source.ts
|
translations/subsurface_source.ts
|
||||||
translations/subsurface_bg_BG.ts
|
translations/subsurface_bg_BG.ts
|
||||||
translations/subsurface_cs.ts
|
translations/subsurface_cs.ts
|
||||||
|
@ -404,19 +404,7 @@ set(QTTRANSLATIONS_BASE
|
||||||
# translations/subsurface_hu.ts \
|
# translations/subsurface_hu.ts \
|
||||||
# translations/subsurface_ro_RO.ts \
|
# translations/subsurface_ro_RO.ts \
|
||||||
|
|
||||||
# if we apply the REGEX to TRANSLATION_SRC then the list of files turns
|
ADD_CUSTOM_TARGET (translations ALL DEPENDS ${TRANSLATIONS})
|
||||||
# into a single string, so we assemble it file name by file name
|
|
||||||
foreach(TRANSLATION ${TRANSLATION_SRC})
|
|
||||||
string(REGEX REPLACE \\.ts .qm TRANSLATION_QM ${TRANSLATION})
|
|
||||||
string(REGEX REPLACE "/" "-" TRANSLATION_TARGET ${TRANSLATION_QM})
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/${TRANSLATION_QM}
|
|
||||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/translations \\; ${LRELEASE} ${CMAKE_SOURCE_DIR}/${TRANSLATION} -qm ${CMAKE_BINARY_DIR}/${TRANSLATION_QM}
|
|
||||||
DEPENDS ${TRANSLATION}
|
|
||||||
)
|
|
||||||
set(TRANSLATIONS ${TRANSLATIONS} ${CMAKE_BINARY_DIR}/${TRANSLATION_QM})
|
|
||||||
endforeach()
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(main.cpp PROPERTIES OBJECT_DEPENDS "${TRANSLATIONS}")
|
|
||||||
|
|
||||||
if(QT_TRANSLATION_DIR STREQUAL "")
|
if(QT_TRANSLATION_DIR STREQUAL "")
|
||||||
set(QT_TRANSLATION_DIR ${Qt5Core_DIR}/../../../translations)
|
set(QT_TRANSLATION_DIR ${Qt5Core_DIR}/../../../translations)
|
||||||
|
|
Loading…
Reference in a new issue