<commit_before>#  funtion lxqt_translate_ts(qm_files 
#                           SOURCES sources ... 
#                           [TRANSLATION_DIR] translation_directory
#                           [INSTALLATION_DIR] qm_install_directory
#                          )
#     out: qm_files 
#     generates commands to create .ts.src and .qm files from sources. 
#     The generated filenames can be found in qm_files.
#
#     in: sources 
#     List of the h, cpp and ui files
#
#     in: translation_directory
#     A relative path to the directory with .ts files, it is relative 
#     to the CMakeList.txt. By default is "translations"
#
#     in: qm_install_directory
#     A full path to the directory n which will be installed .qm files.
#     By default is "${CMAKE_INSTALL_PREFIX}/share/lxqt/${PROJECT_NAME}" 

if(USE_QT5)
	get_target_property(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE} LOCATION)
	get_target_property(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE} LOCATION)
endif()

MACRO(QTX_ADD_TRANSLATION_FIXED _qm_files)
  FOREACH (_current_FILE ${ARGN})
    GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
    GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME)
    #Extract the real extension ............
    STRING(REPLACE ".ts" "" qm ${qm})
    GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
    IF(output_location)
      FILE(MAKE_DIRECTORY "${output_location}")
      SET(qm "${output_location}/${qm}.qm")
    ELSE(output_location)
      SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
    ENDIF(output_location)

    ADD_CUSTOM_COMMAND(OUTPUT ${qm}
       COMMAND ${QT_LRELEASE_EXECUTABLE}
       ARGS -silent -removeidentical ${_abs_FILE} -qm ${qm}
       DEPENDS ${_abs_FILE}
    )
    SET(${_qm_files} ${${_qm_files}} ${qm})
  ENDFOREACH (_current_FILE)
ENDMACRO(QTX_ADD_TRANSLATION_FIXED)

if(NOT TARGET UpdateTsFiles)
  add_custom_target(UpdateTsFiles DEPENDS)
endif()

if(NOT TARGET UpdateTxFile)
  file(WRITE ${CMAKE_BINARY_DIR}/tx/_updateTxFile.sh
        "echo '[main]'\n"
        "echo 'host = https://www.transifex.com'\n"
        "echo 'minimum_perc = 1'\n"
        "echo ''\n"
        "for f in `ls ${CMAKE_BINARY_DIR}/tx/*.tx.sh`; do\n"
        " sh $f;\n"
        "done\n"
      )

  add_custom_target(UpdateTxFile  
    COMMAND sh ${CMAKE_BINARY_DIR}/tx/_updateTxFile.sh > ${CMAKE_SOURCE_DIR}/.tx/config
  )
endif()


function(lxqt_translate_ts _qmFiles)
    set(_translationDir "translations")
    set(_installDir "${CMAKE_INSTALL_PREFIX}/share/lxqt/${PROJECT_NAME}")
    
    # Parse arguments ***************************************
    set(_state "")
    foreach (_arg ${ARGN})<commit_msg>Updates translations files install destination<commit_after>#  funtion lxqt_translate_ts(qm_files 
#                           SOURCES sources ... 
#                           [TRANSLATION_DIR] translation_directory
#                           [INSTALLATION_DIR] qm_install_directory
#                          )
#     out: qm_files 
#     generates commands to create .ts.src and .qm files from sources. 
#     The generated filenames can be found in qm_files.
#
#     in: sources 
#     List of the h, cpp and ui files
#
#     in: translation_directory
#     A relative path to the directory with .ts files, it is relative 
#     to the CMakeList.txt. By default is "translations"
#
#     in: qm_install_directory
#     A full path to the directory n which will be installed .qm files.
#     By default is "${CMAKE_INSTALL_PREFIX}/share/lxqt/${PROJECT_NAME}" 

if(USE_QT5)
	get_target_property(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE} LOCATION)
	get_target_property(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE} LOCATION)
endif()

MACRO(QTX_ADD_TRANSLATION_FIXED _qm_files)
  FOREACH (_current_FILE ${ARGN})
    GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
    GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME)
    #Extract the real extension ............
    STRING(REPLACE ".ts" "" qm ${qm})
    GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
    IF(output_location)
      FILE(MAKE_DIRECTORY "${output_location}")
      SET(qm "${output_location}/${qm}.qm")
    ELSE(output_location)
      SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
    ENDIF(output_location)

    ADD_CUSTOM_COMMAND(OUTPUT ${qm}
       COMMAND ${QT_LRELEASE_EXECUTABLE}
       ARGS -silent -removeidentical ${_abs_FILE} -qm ${qm}
       DEPENDS ${_abs_FILE}
    )
    SET(${_qm_files} ${${_qm_files}} ${qm})
  ENDFOREACH (_current_FILE)
ENDMACRO(QTX_ADD_TRANSLATION_FIXED)

if(NOT TARGET UpdateTsFiles)
  add_custom_target(UpdateTsFiles DEPENDS)
endif()

if(NOT TARGET UpdateTxFile)
  file(WRITE ${CMAKE_BINARY_DIR}/tx/_updateTxFile.sh
        "echo '[main]'\n"
        "echo 'host = https://www.transifex.com'\n"
        "echo 'minimum_perc = 1'\n"
        "echo ''\n"
        "for f in `ls ${CMAKE_BINARY_DIR}/tx/*.tx.sh`; do\n"
        " sh $f;\n"
        "done\n"
      )

  add_custom_target(UpdateTxFile  
    COMMAND sh ${CMAKE_BINARY_DIR}/tx/_updateTxFile.sh > ${CMAKE_SOURCE_DIR}/.tx/config
  )
endif()


function(lxqt_translate_ts _qmFiles)
    set(_translationDir "translations")
    set(_installDir "${CMAKE_INSTALL_PREFIX}/share/${LXQT_LIBRARY}/${PROJECT_NAME}")
    
    # Parse arguments ***************************************
    set(_state "")
    foreach (_arg ${ARGN})
{'fraction_non_alphanumeric': 0.1292782738095238, 'fraction_numerical': 0.001488095238095238, 'mean_word_length': 3.24388318863457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3362689', 'n_tokens_mistral': 1953, 'n_tokens_neox': 1880, 'n_words': 371}