From 40335d9f1eff4a50732d84137acbb81acc39f91e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 18 Aug 2017 12:06:32 -0400 Subject: [PATCH] Python-i18n: install mo files into build tree --- CMakeModules/CalamaresAddTranslations.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeModules/CalamaresAddTranslations.cmake b/CMakeModules/CalamaresAddTranslations.cmake index 9ac5ab2b6..520c918aa 100644 --- a/CMakeModules/CalamaresAddTranslations.cmake +++ b/CMakeModules/CalamaresAddTranslations.cmake @@ -49,7 +49,7 @@ endmacro() # # Translations of the Python modules that don't have their own # lang/ subdirectories -- these are collected in top-level -# lang/python_.po +# lang/python//LC_MESSAGES/python.mo macro(add_calamares_python_translations language) set( CALAMARES_LANGUAGES "" ) list( APPEND CALAMARES_LANGUAGES ${ARGV} ) @@ -110,6 +110,12 @@ function( install_calamares_gettext_translations ) ) # TODO: make translations available in build dir too, for # translation when running calamares -d from builddir. + set(_build_lc ${CMAKE_BINARY_DIR}/lang/${lang}/LC_MESSAGES/) + file(COPY ${lang_mo} DESTINATION ${_build_lc}) + if (NOT TRANSLATION_NAME STREQUAL TRANSLATION_RENAME) + file(RENAME ${_build_lc}${TRANSLATION_NAME}.mo ${_build_lc}${TRANSLATION_RENAME}) + endif() + endif() endforeach() endfunction()