diff options
author | YuSanka <yusanka@gmail.com> | 2021-12-21 15:27:31 +0300 |
---|---|---|
committer | Oleksandra Yushchenko <yusanka@gmail.com> | 2022-01-04 18:31:27 +0300 |
commit | 34d9fbdc357fb3a4ea5ddbcf0c209e2be31214c6 (patch) | |
tree | 66b1593b3352882b891ebfb8a9480809ab26f8f1 /CMakeLists.txt | |
parent | fb4928237d7ca1cf4f76264f70b8dec2dcb9ddea (diff) |
Fixes for localization of the PrusaSlicer - 2.4.0
* Added some missed phrases.
* Added some missed files to the list.txt
* Fix for https://github.com/prusa3d/PrusaSlicer/issues/7114 - Reword of the "Ask for unsaved changes..."
* Fix for https://github.com/prusa3d/PrusaSlicer/issues/7542 - Added localization for default buttons Yes/No
Note: For some default buttons/labels/dialogs/... is used localization in wxWidgets.
But dictionaries have to contain this strings, otherwise texts wouldn't be localized.
"wxWidgets/local" contains dictionaries for all this default phrases.
So, a copy of this field is added as a "wx_local" field to the "resources/localization" field.
And a "gettext_concat_wx_po_with_po" script is written to concatenate strings from wx_local/lang_code.po to resources/localization/lang_code/PrusaSlicer_lang_code.po.
So, to create a MO file from updated PO we have to execute "gettext_concat_wx_po_with_po" and only then execute a "gettext_po_to_mo" script.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 227cf5326..37c5a18eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -491,14 +491,33 @@ add_custom_target(gettext_merge_po_with_pot ) file(GLOB L10N_PO_FILES "${L10N_DIR}/*/PrusaSlicer*.po") foreach(po_file ${L10N_PO_FILES}) - GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY) - SET(po_new_file "${po_dir}/PrusaSlicer_.po") + #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" DEPENDS ${po_file} ) endforeach() + +add_custom_target(gettext_concat_wx_po_with_po + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + 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) + SET(wx_po_file "${L10N_DIR}/wx_locale/${po_dir_name}.po") + #SET(po_new_file "${po_dir}/PrusaSlicer_.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} + DEPENDS ${po_file} + ) +endforeach() + add_custom_target(gettext_po_to_mo WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generate localization po files (binary) from mo files (texts)" |