Skip to content

Commit a5069f6

Browse files
committed
ENH: MRML Lib add i18n support and ts files.
1 parent cd01a74 commit a5069f6

File tree

5 files changed

+8185
-5
lines changed

5 files changed

+8185
-5
lines changed

Libs/MRML/Widgets/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,29 @@ if(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
460460
DESTINATION include/${PROJECT_NAME} COMPONENT Development)
461461
endif()
462462

463+
# --------------------------------------------------------------------------
464+
# Translation
465+
# --------------------------------------------------------------------------
466+
if(Slicer_BUILD_I18N_SUPPORT)
467+
set(TS_DIR
468+
"${CMAKE_CURRENT_SOURCE_DIR}/Resources/Translations/"
469+
)
470+
get_property(Slicer_LANGUAGES GLOBAL PROPERTY Slicer_LANGUAGES)
471+
472+
include(SlicerMacroTranslation)
473+
SlicerMacroTranslation(
474+
SRCS ${MRMLWidgets_SRCS}
475+
UI_SRCS ${MRMLWidgets_UI_SRCS}
476+
TS_DIR ${TS_DIR}
477+
TS_BASEFILENAME ${PROJECT_NAME}
478+
TS_LANGUAGES ${Slicer_LANGUAGES}
479+
QM_OUTPUT_DIR_VAR QM_OUTPUT_DIR
480+
QM_OUTPUT_FILES_VAR QM_OUTPUT_FILES
481+
)
482+
483+
set_property(GLOBAL APPEND PROPERTY Slicer_QM_OUTPUT_DIRS ${QM_OUTPUT_DIR})
484+
endif()
485+
463486
# --------------------------------------------------------------------------
464487
# Build library
465488
# --------------------------------------------------------------------------
@@ -471,6 +494,7 @@ add_library(${lib_name}
471494
${MRMLWidgets_MOC_CXX}
472495
${MRMLWidgets_UI_CXX}
473496
${MRMLWidgets_QRC_CXX}
497+
${QM_OUTPUT_FILES}
474498
)
475499

476500
set(MRMLWidgets_LIBRARIES

0 commit comments

Comments
 (0)