Skip to content
Snippets Groups Projects
Commit 7e51e261 authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Guillaume Roguez
Browse files

translations: compile and install .qm files

This patch adds support via Cmake for compiling .ts translation files into
the .qm files which are used at runtime. These files are installed into:
<install prefix>/share/libringclient/translations dir, following the qt lib
convention. The .ts files are expected to be in the translations/ dir,
following the 'lrc_<language code>.ts' naming convention.

Issue: #78928
Change-Id: If9c1e8520ccee58ed8ce573bd2703e029fcc7b37
parent f3a013be
Branches
Tags
No related merge requests found
...@@ -180,6 +180,7 @@ ENDIF(NOT (${ENABLE_VIDEO} MATCHES false)) ...@@ -180,6 +180,7 @@ ENDIF(NOT (${ENABLE_VIDEO} MATCHES false))
FIND_PACKAGE(Qt5Core REQUIRED) FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5DBus) FIND_PACKAGE(Qt5DBus)
FIND_PACKAGE(Qt5LinguistTools) # translations
# ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=1) # ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=1)
SET(GENERIC_LIB_VERSION "0.4.0") SET(GENERIC_LIB_VERSION "0.4.0")
...@@ -729,3 +730,20 @@ INSTALL( FILES ${libringclient_CONFIG_PATH} ...@@ -729,3 +730,20 @@ INSTALL( FILES ${libringclient_CONFIG_PATH}
# VERSION ${GENERIC_LIB_VERSION} # VERSION ${GENERIC_LIB_VERSION}
# COMPATIBILITY SameMajorVersion # COMPATIBILITY SameMajorVersion
# ) # )
# translations
IF( Qt5LinguistTools_FOUND )
# translation template file
SET(TS_TEMPLATE ${CMAKE_SOURCE_DIR}/translations/lrc_en.ts)
# get all translation files except the template
FILE(GLOB TS_FILES ${CMAKE_SOURCE_DIR}/translations/*.ts)
LIST(REMOVE_ITEM TS_FILES ${TS_TEMPLATE})
# compiled .qm files
QT5_ADD_TRANSLATION(QM_FILES ${TS_FILES})
ADD_CUSTOM_TARGET(translations ALL DEPENDS ${QM_FILES})
INSTALL(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/libringclient/translations")
ENDIF()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment