2015-12-07 11:17:08 -06:00
|
|
|
|
|
|
|
|
|
|
|
# Set of available languages.
|
2016-01-20 10:46:01 -06:00
|
|
|
SET (TP_LINGUAS az ca cs da eu fa ja nl rw sk sr sv tr uk zh_CN)
|
2015-12-07 11:17:08 -06:00
|
|
|
# already marked as external at TP:
|
2016-01-20 10:46:01 -06:00
|
|
|
SET (GC_LINGUAS ar bg de el en_GB es fi fr gu he hi hu it kn ko lt lv mr nb ne pl pt pt_BR ro ru ta te ur vi zh_TW)
|
2015-12-07 11:17:08 -06:00
|
|
|
# not marked or no TP team:
|
|
|
|
SET (NEW_LINGUAS as brx doi es_NI kok kok@latin ks mai mni mni@bengali)
|
|
|
|
|
|
|
|
SET (ALL_LINGUAS ${TP_LINGUAS} ${GC_LINGUAS} ${NEW_LINGUAS})
|
|
|
|
|
|
|
|
SET (CATALOGS "")
|
|
|
|
SET (BUILD_CATALOGS "")
|
2016-01-13 10:45:29 -06:00
|
|
|
|
|
|
|
SET(CMAKE_COMMAND_TMP "")
|
|
|
|
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
|
|
|
|
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
|
|
|
|
ENDIF()
|
|
|
|
|
2015-12-07 11:17:08 -06:00
|
|
|
FOREACH(lingua ${ALL_LINGUAS})
|
|
|
|
SET(_OUTPUT_FILE ${lingua}.gmo)
|
|
|
|
LIST(APPEND CATALOGS ${_OUTPUT_FILE})
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT ${_OUTPUT_FILE}
|
2016-01-13 10:45:29 -06:00
|
|
|
COMMAND ${CMAKE_COMMAND_TMP} ${MSGFMT} -o ${_OUTPUT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${lingua}.po
|
2015-12-07 11:17:08 -06:00
|
|
|
)
|
|
|
|
IF (GNC_BUILD_AS_INSTALL)
|
|
|
|
SET(_BUILD_FILE_DIR ${DATADIR_BUILD}/locale/${lingua}/LC_MESSAGES)
|
|
|
|
MAKE_DIRECTORY(${_BUILD_FILE_DIR})
|
|
|
|
SET(_BUILD_FILE ${_BUILD_FILE_DIR}/gnucash.gmo)
|
|
|
|
LIST(APPEND BUILD_CATALOGS ${_BUILD_FILE})
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT ${_BUILD_FILE}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${lingua}.gmo ${_BUILD_FILE}
|
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_OUTPUT_FILE}
|
|
|
|
#APPEND
|
|
|
|
)
|
|
|
|
ENDIF()
|
|
|
|
ENDFOREACH(lingua)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(po-gmo ALL DEPENDS ${CATALOGS})
|
|
|
|
IF (GNC_BUILD_AS_INSTALL)
|
|
|
|
ADD_CUSTOM_TARGET(po-gmo-build ALL DEPENDS ${BUILD_CATALOGS})
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
FOREACH(lingua ${ALL_LINGUAS})
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lingua}.gmo RENAME gnucash.mo DESTINATION share/locale/${lingua}/LC_MESSAGES)
|
2016-01-20 10:46:01 -06:00
|
|
|
ENDFOREACH(lingua)
|