File: generate_translations.cmake

package info (click to toggle)
leatherman 1.4.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,944 kB
  • sloc: cpp: 14,555; python: 3,105; sh: 45; makefile: 9; ruby: 1
file content (17 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Generates or updates translation files from a pot file using msginit or msgmerge.
#
# Usage:
#   cmake -DPOT_FILE=<pot_file_name> \
#         -DLANG_FILE=<lang_file_name> \
#         -DLANG=<language> \
#         -DMSGMERGE_EXE=<path_to_msgmerge> \
#         -DMSGINIT_EXE=<path_to_msginit> \
#         -P generate_translations.cmake

if (EXISTS ${LANG_FILE})
    message(STATUS "Updating ${LANG_FILE}")
    execute_process(COMMAND ${MSGMERGE_EXE} -U ${LANG_FILE} ${POT_FILE})
else()
    execute_process(COMMAND ${MSGINIT_EXE} --no-translator -l ${LANG}.UTF-8 -o ${LANG_FILE} -i ${POT_FILE})
endif()