Fix to the way translations are handled. Also updated the german translation with the new strings.

This commit is contained in:
Jan Dalheimer 2014-02-25 18:46:50 +01:00
parent 3133bb3ea0
commit 00f4f533aa
3 changed files with 1092 additions and 157 deletions

View File

@ -758,24 +758,8 @@ INCLUDE(CPack)
include_directories(${PROJECT_BINARY_DIR}/include)
### translation stuff
file (GLOB TRANSLATIONS_FILES translations/*.ts)
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files (WARNING: make clean will delete the source .ts files! Danger!)")
IF(UPDATE_TRANSLATIONS)
qt5_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
ELSE()
qt5_add_translation(QM_FILES ${TRANSLATIONS_FILES})
ENDIF()
add_custom_target (translations DEPENDS ${QM_FILES})
IF(APPLE AND UNIX) ## OSX
install(FILES ${QM_FILES} DESTINATION MultiMC.app/Contents/MacOS/translations)
ELSE()
install(FILES ${QM_FILES} DESTINATION translations)
ENDIF()
# Translations
add_subdirectory(translations)
# Tests
add_subdirectory(tests)

View File

@ -0,0 +1,20 @@
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
### translation stuff
file(GLOB TRANSLATION_FILES ${CMAKE_CURRENT_LIST_DIR}/*.ts)
set(FILES_TO_TRANSLATE_ABSOLUTE)
foreach(file ${FILES_TO_TRANSLATE})
list(APPEND FILES_TO_TRANSLATE_ABSOLUTE "${CMAKE_SOURCE_DIR}/${file}")
endforeach()
qt5_create_translation(TRANSLATION_MESSAGES ${FILES_TO_TRANSLATE_ABSOLUTE} ${TRANSLATION_FILES})
qt5_add_translation(TRANSLATION_QM ${TRANSLATION_FILES})
add_custom_target(translations_update DEPENDS ${TRANSLATION_MESSAGES})
add_custom_target(translations DEPENDS ${TRANSLATION_QM})
IF(APPLE AND UNIX) ## OSX
install(FILES ${TRANSLATION_QM} DESTINATION MultiMC.app/Contents/MacOS/translations)
ELSE()
install(FILES ${TRANSLATION_QM} DESTINATION translations)
ENDIF()

File diff suppressed because it is too large Load Diff