i18n: install Python translations from a sensible place

- put the installation code in lang/ rather than among the modules
- remove useless indirection through CMake macro
This commit is contained in:
Adriaan de Groot 2020-08-27 13:59:23 +02:00
parent 23bfcb755e
commit 242d5c6499
3 changed files with 8 additions and 18 deletions

View File

@ -48,22 +48,6 @@ macro(add_calamares_translations language)
)
endmacro()
# Internal macro for Python translations
#
# Translations of the Python modules that don't have their own
# lang/ subdirectories -- these are collected in top-level
# lang/python/<lang>/LC_MESSAGES/python.mo
macro(add_calamares_python_translations language)
set( CALAMARES_LANGUAGES "" )
list( APPEND CALAMARES_LANGUAGES ${ARGV} )
install_calamares_gettext_translations( python
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lang/python
FILENAME python.mo
RENAME calamares-python.mo
)
endmacro()
# Installs a directory containing language-code-labeled subdirectories with
# gettext data into the appropriate system directory. Allows renaming the
# .mo files during install to avoid namespace clashes.

View File

@ -5,8 +5,16 @@
#
###
include( CalamaresAddTranslations )
find_package(Qt5 COMPONENTS Xml)
if( Qt5Xml_FOUND )
add_executable(txload txload.cpp)
target_link_libraries(txload Qt5::Xml)
endif()
install_calamares_gettext_translations( python
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lang/python
FILENAME python.mo
RENAME calamares-python.mo
)

View File

@ -73,8 +73,6 @@ foreach( _category ${_use_categories} )
endif()
endforeach()
add_calamares_python_translations( ${CALAMARES_TRANSLATION_LANGUAGES} )
# TODO:3.3: Use FindPython3
if ( BUILD_TESTING AND BUILD_SCHEMA_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE )
# The tests for each config file are independent of whether the