summaryrefslogtreecommitdiff
path: root/cmake/Translations.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Translations.cmake')
-rwxr-xr-xcmake/Translations.cmake93
1 files changed, 1 insertions, 92 deletions
diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake
index d6979c4..1f36bb6 100755
--- a/cmake/Translations.cmake
+++ b/cmake/Translations.cmake
@@ -6,9 +6,7 @@ macro (add_translations_directory NLS_PACKAGE)
# be sure that all languages are present
# Using all usual languages code from https://www.gnu.org/software/gettext/manual/html_node/Language-Codes.html#Language-Codes
# Rare language codes should be added on-demand.
- set (LANGUAGES_NEEDED en ru)
- string (REPLACE ";" " " LINGUAS "${LANGUAGES_NEEDED}")
- configure_file (${CMAKE_CURRENT_SOURCE_DIR}/LINGUAS.in ${CMAKE_CURRENT_BINARY_DIR}/LINGUAS)
+ file(STRINGS LINGUAS LANGUAGES_NEEDED)
foreach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED})
create_po_file (${LANGUAGE_NEEDED})
endforeach (LANGUAGE_NEEDED ${LANGUAGES_NEEDED})
@@ -26,31 +24,6 @@ macro (add_translations_directory NLS_PACKAGE)
RENAME ${NLS_PACKAGE}.mo
COMPONENT ${ARGV1})
endforeach (PO_INPUT ${PO_FILES})
- #Create *.desktop files
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/*.desktop.plugin.in)
- foreach(PLUGIN_DESKTOP_IN_FILE ${SOURCE_FILES})
- get_filename_component( BASE_NAME ${PLUGIN_DESKTOP_IN_FILE} NAME )
- string(REGEX REPLACE ".desktop.plugin.in$" "" PLUGIN_FILE ${BASE_NAME})
- get_filename_component( BASE_DIRECTORY ${PLUGIN_DESKTOP_IN_FILE} PATH )
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY})
- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} --desktop --keyword=Name --keyword=Description --keyword=Help -d ${CMAKE_CURRENT_BINARY_DIR} --template ${CMAKE_SOURCE_DIR}/${PLUGIN_DESKTOP_IN_FILE} -o ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}/${PLUGIN_FILE}.plugin)
- endforeach()
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/*.desktop.in)
- foreach(DESKTOP_IN_FILE ${SOURCE_FILES})
- get_filename_component( BASE_NAME ${DESKTOP_IN_FILE} NAME )
- string(REGEX REPLACE ".desktop.in$" "" PLUGIN_FILE ${BASE_NAME})
- get_filename_component( BASE_DIRECTORY ${DESKTOP_IN_FILE} PATH )
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY})
- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} --desktop -d ${CMAKE_CURRENT_BINARY_DIR} --template ${CMAKE_SOURCE_DIR}/${DESKTOP_IN_FILE} -o ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}/${PLUGIN_FILE}.desktop)
- endforeach()
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/*.desktop.xfce.in)
- foreach(XFCE_DESKTOP_IN_FILE ${SOURCE_FILES})
- get_filename_component( BASE_NAME ${XFCE_DESKTOP_IN_FILE} NAME )
- string(REGEX REPLACE ".desktop.xfce.in$" "" PLUGIN_FILE ${BASE_NAME})
- get_filename_component( BASE_DIRECTORY ${XFCE_DESKTOP_IN_FILE} PATH )
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY})
- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} --desktop --keyword=Name --keyword=Comment --keyword=Help -d ${CMAKE_CURRENT_BINARY_DIR} --template ${CMAKE_SOURCE_DIR}/${XFCE_DESKTOP_IN_FILE} -o ${CMAKE_BINARY_DIR}/${BASE_DIRECTORY}/${PLUGIN_FILE}.desktop)
- endforeach()
endmacro (add_translations_directory)
# Apply the right default template.
@@ -120,11 +93,6 @@ macro (add_translations_catalog NLS_PACKAGE)
find_program (XGETTEXT_EXECUTABLE xgettext)
set(C_SOURCE "")
- set(VALA_SOURCE "")
- set(GLADE_SOURCE "")
- set(PLUGIN_DESKTOP_SOURCE "")
- set(DESKTOP_SOURCE "")
- set(XML_SOURCE "")
foreach(FILES_INPUT ${ARGN})
set(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
@@ -133,36 +101,6 @@ macro (add_translations_catalog NLS_PACKAGE)
foreach(C_FILE ${SOURCE_FILES})
set(C_SOURCE ${C_SOURCE} ${C_FILE})
endforeach()
-
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.vala)
- foreach(VALA_C_FILE ${SOURCE_FILES})
- set(VALA_SOURCE ${VALA_SOURCE} ${VALA_C_FILE})
- endforeach()
-
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.ui)
- foreach(GLADE_C_FILE ${SOURCE_FILES})
- set(GLADE_SOURCE ${GLADE_SOURCE} ${GLADE_C_FILE})
- endforeach()
-
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.desktop.plugin.in)
- foreach(PLUGIN_DESKTOP_IN_FILE ${SOURCE_FILES})
- set(PLUGIN_DESKTOP_SOURCE ${PLUGIN_DESKTOP_SOURCE} ${PLUGIN_DESKTOP_IN_FILE})
- endforeach()
-
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.desktop.xfce.in)
- foreach(XFCE_DESKTOP_IN_FILE ${SOURCE_FILES})
- set(XFCE_DESKTOP_SOURCE ${XFCE_DESKTOP_SOURCE} ${XFCE_DESKTOP_IN_FILE})
- endforeach()
-
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.xml.in)
- foreach(XML_IN_FILE ${SOURCE_FILES})
- set(XML_SOURCE ${PLUGIN_DESKTOP_SOURCE} ${XML_IN_FILE})
- endforeach()
-
- file (GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/ ${BASE_DIRECTORY}/*.desktop.in)
- foreach(DESKTOP_IN_FILE ${SOURCE_FILES})
- set(DESKTOP_SOURCE ${DESKTOP_SOURCE} ${DESKTOP_IN_FILE})
- endforeach()
endforeach()
set(BASE_XGETTEXT_COMMAND
@@ -176,33 +114,4 @@ macro (add_translations_catalog NLS_PACKAGE)
add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${C_SOURCE})
set(CONTINUE_FLAG "-j")
ENDIF()
-
- IF(NOT "${VALA_SOURCE}" STREQUAL "")
- add_custom_command(TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LC\# ${VALA_SOURCE})
- set(CONTINUE_FLAG "-j")
- ENDIF()
-
- IF(NOT "${GLADE_SOURCE}" STREQUAL "")
- add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGlade ${GLADE_SOURCE})
- set(CONTINUE_FLAG "-j")
- ENDIF()
-
- IF(NOT "${PLUGIN_DESKTOP_SOURCE}" STREQUAL "")
- add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -Ldesktop -kName -kDescription -kHelp ${PLUGIN_DESKTOP_SOURCE})
- set(CONTINUE_FLAG "-j")
- ENDIF()
-
- IF(NOT "${XFCE_DESKTOP_SOURCE}" STREQUAL "")
- add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -Ldesktop -kName -kComment -kHelp ${XFCE_DESKTOP_SOURCE})
- set(CONTINUE_FLAG "-j")
- ENDIF()
-
- IF(NOT "${DESKTOP_SOURCE}" STREQUAL "")
- add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -Ldesktop ${DESKTOP_SOURCE})
- set(CONTINUE_FLAG "-j")
- ENDIF()
-
- IF(NOT "${XML_SOURCE}" STREQUAL "")
- add_custom_command (TARGET pot WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGsettings ${XML_SOURCE})
- ENDIF()
endmacro ()