attempted to implement localization loading

This commit is contained in:
itsmattkc
2020-11-17 16:04:09 +11:00
parent 8a64ef75d9
commit b9724e3910
14 changed files with 4972 additions and 67 deletions
+16 -11
View File
@@ -43,6 +43,7 @@ add_subdirectory(shaders)
add_subdirectory(task)
add_subdirectory(threading)
add_subdirectory(timeline)
add_subdirectory(ts)
add_subdirectory(tool)
add_subdirectory(ui)
add_subdirectory(undo)
@@ -62,11 +63,25 @@ if(APPLE)
)
endif()
# Add translations
qt5_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES})
set(QRC_BODY "")
foreach(QM_FILE ${OLIVE_QM_FILES})
get_filename_component(QM_FILENAME_COMPONENT ${QM_FILE} NAME_WE)
string(APPEND QRC_BODY "<file alias=\"${QM_FILENAME_COMPONENT}\">${QM_FILE}</file>\n")
endforeach()
configure_file(ts/translations.qrc.in ts/translations.qrc @ONLY)
set(OLIVE_RESOURCES
${OLIVE_RESOURCES}
${CMAKE_CURRENT_BINARY_DIR}/ts/translations.qrc
)
# Add executable
add_executable(${OLIVE_TARGET}
${OLIVE_SOURCES}
${OLIVE_RESOURCES}
${OLIVE_QM_FILES}
)
if(APPLE)
@@ -265,16 +280,6 @@ endif()
# Set compiler definitions
target_compile_definitions(${OLIVE_TARGET} PRIVATE ${OLIVE_DEFINITIONS})
set(OLIVE_TS_FILES
# FIXME: Empty variable
)
if(UPDATE_TS)
qt5_create_translation(OLIVE_QM_FILES ${CMAKE_SOURCE_DIR} ${OLIVE_TS_FILES})
else()
qt5_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES})
endif()
add_subdirectory(packaging)
if(DOXYGEN_FOUND)