diff options
author | supermerill <merill@free.fr> | 2022-02-28 00:59:06 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2022-02-28 00:59:06 +0300 |
commit | 4a998a97f66011cb20fbd9ecc1b2f7ee3ef3b0af (patch) | |
tree | 0fa9b3e568712929d4e0602e1cd8b95ac1e9d401 /CMakeLists.txt | |
parent | 20edf47a673a75f1f5a08b4972ab1a044969a8ec (diff) | |
parent | 54b2c67e75c9b992c6929b7b32b2f1f98bb38b44 (diff) |
Merge tag 'version_2.4.1-beta3' into dev
version_2.4.1-beta3
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b049be5d0..0411c9f87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -506,34 +506,40 @@ add_custom_target(gettext_make_pot WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generate pot file from strings in the source tree" ) -add_custom_target(gettext_merge_po_with_pot + +add_custom_target(gettext_merge_community_po_with_pot WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMENT "Merge localization po with new generted pot file" + COMMENT "Merge community po with new generated pot file" ) -file(GLOB L10N_PO_FILES "${L10N_DIR}/*/${SLIC3R_APP_KEY}*.po") +file(GLOB L10N_PO_FILES "${L10N_DIR}/*/Slic3r*.po") +# list of names of directories, which are licalized by PS internally +list(APPEND PS_L10N_DIRS "cs" "de" "es" "fr" "it" "ja" "pl") foreach(po_file ${L10N_PO_FILES}) - #GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY) - #SET(po_new_file "${po_dir}/${SLIC3R_APP_KEY}_.po") + GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY) + GET_FILENAME_COMPONENT(po_dir_name "${po_dir}" NAME) + list(FIND PS_L10N_DIRS ${po_dir_name} found_dir_id) + # found_dir_id==-1 means that po_dir_name wasn't found in PS_L10N_DIRS + if(found_dir_id LESS 0) add_custom_command( - TARGET gettext_merge_po_with_pot PRE_BUILD - COMMAND msgmerge -N -o ${po_file} ${po_file} "${L10N_DIR}/${SLIC3R_APP_KEY}.pot" + TARGET gettext_merge_community_po_with_pot PRE_BUILD + COMMAND msgmerge -N -o ${po_file} ${po_file} "${L10N_DIR}/Slic3r.pot" # delete obsolete lines from resulting PO to avoid conflicts after a merging of it with wxWidgets.po COMMAND msgattrib --no-obsolete -o ${po_file} ${po_file} DEPENDS ${po_file} ) + endif() endforeach() add_custom_target(gettext_concat_wx_po_with_po WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Concatenate and merge wxWidgets localization po with Slic3r po file" ) -file(GLOB L10N_PO_FILES "${L10N_DIR}/*/${SLIC3R_APP_KEY}*.po") -file(GLOB L10N_WX_PO_FILES "${L10N_DIR}/*/${SLIC3R_APP_KEY}*.po") +file(GLOB L10N_PO_FILES "${L10N_DIR}/*/Slic3r*.po") foreach(po_file ${L10N_PO_FILES}) GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY) GET_FILENAME_COMPONENT(po_dir_name "${po_dir}" NAME) SET(wx_po_file "${L10N_DIR}/wx_locale/${po_dir_name}.po") - #SET(po_new_file "${po_dir}/${SLIC3R_APP_KEY}_.po") + #SET(po_new_file "${po_dir}/Slic3r_.po") add_custom_command( TARGET gettext_concat_wx_po_with_po PRE_BUILD COMMAND msgcat --use-first -o ${po_file} ${po_file} ${wx_po_file} |