diff options
author | YuSanka <yusanka@gmail.com> | 2022-02-09 14:52:50 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2022-02-09 14:52:50 +0300 |
commit | d52807ccaf4dab0d45305b64fc7d5e65c4294fe3 (patch) | |
tree | e925e41515cc277f85938c0c9682a59d1ac65175 /CMakeLists.txt | |
parent | d0b694daffaa77da6ec07d3a5ebf78e91ed6af8d (diff) |
Localization: Updated POT.
+ Changed a script of the merging new POT with existing PO files.
Now it processes just a PO-files which are provided by community.
Community PO-files are updated from the new POT
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8557ab0d7..a01bb7364 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -485,21 +485,28 @@ 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}/*/PrusaSlicer*.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}/PrusaSlicer_.po") - add_custom_command( - TARGET gettext_merge_po_with_pot PRE_BUILD - COMMAND msgmerge -N -o ${po_file} ${po_file} "${L10N_DIR}/PrusaSlicer.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} - ) + 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_community_po_with_pot PRE_BUILD + COMMAND msgmerge -N -o ${po_file} ${po_file} "${L10N_DIR}/PrusaSlicer.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 @@ -507,7 +514,6 @@ add_custom_target(gettext_concat_wx_po_with_po COMMENT "Concatenate and merge wxWidgets localization po with PrusaSlicer po file" ) file(GLOB L10N_PO_FILES "${L10N_DIR}/*/PrusaSlicer*.po") -file(GLOB L10N_WX_PO_FILES "${L10N_DIR}/*/PrusaSlicer*.po") foreach(po_file ${L10N_PO_FILES}) GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY) GET_FILENAME_COMPONENT(po_dir_name "${po_dir}" NAME) |