OpenToonz - An open-source full-featured 2D animation creation software
C
build: enable automatic translation generation with CMake
Anderson Prado5fa511934f09
diff --git a/stuff/config/loc/Deutsch/colorfx.qm b/stuff/config/loc/Deutsch/colorfx.qmdeleted file mode 100644index 874f67fca..000000000Binary files a/stuff/config/loc/Deutsch/colorfx.qm and /dev/null differdiff --git a/stuff/config/loc/Deutsch/tnzcore.qm b/stuff/config/loc/Deutsch/tnzcore.qmdeleted file mode 100644index b26acb1dc..000000000Binary files a/stuff/config/loc/Deutsch/tnzcore.qm and /dev/null differdiff --git a/stuff/config/loc/Deutsch/tnztools.qm b/stuff/config/loc/Deutsch/tnztools.qmdeleted file mode 100644index 94b061839..000000000Binary files a/stuff/config/loc/Deutsch/tnztools.qm and /dev/null differdiff --git a/stuff/config/loc/Deutsch/toonz.qm b/stuff/config/loc/Deutsch/toonz.qmdeleted file mode 100644index 86e3f9419..000000000Binary files a/stuff/config/loc/Deutsch/toonz.qm and /dev/null differdiff --git a/stuff/config/loc/Deutsch/toonzlib.qm b/stuff/config/loc/Deutsch/toonzlib.qmdeleted file mode 100644index 589b3c7b8..000000000Binary files a/stuff/config/loc/Deutsch/toonzlib.qm and /dev/null differdiff --git a/stuff/config/loc/Deutsch/toonzqt.qm b/stuff/config/loc/Deutsch/toonzqt.qmdeleted file mode 100644index 607a00c97..000000000Binary files a/stuff/config/loc/Deutsch/toonzqt.qm and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/colorfx.qm" "b/stuff/config/loc/Espa\303\261ol/colorfx.qm"deleted file mode 100644index 723fc4d0c..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/image.qm" "b/stuff/config/loc/Espa\303\261ol/image.qm"deleted file mode 100644index 43c3b4824..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/image.qm" and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/tnzcore.qm" "b/stuff/config/loc/Espa\303\261ol/tnzcore.qm"deleted file mode 100644index 5f485f1b4..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/tnztools.qm" "b/stuff/config/loc/Espa\303\261ol/tnztools.qm"deleted file mode 100644index ca31b03b2..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/toonz.qm" "b/stuff/config/loc/Espa\303\261ol/toonz.qm"deleted file mode 100644index 644c98ba9..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/toonzlib.qm" "b/stuff/config/loc/Espa\303\261ol/toonzlib.qm"deleted file mode 100644index 02998853c..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/Espa\303\261ol/toonzqt.qm" "b/stuff/config/loc/Espa\303\261ol/toonzqt.qm"deleted file mode 100644index 4a3e0c0aa..000000000Binary files "a/stuff/config/loc/Espa\303\261ol/toonzqt.qm" and /dev/null differdiff --git "a/stuff/config/loc/Fran\303\247ais/colorfx.qm" "b/stuff/config/loc/Fran\303\247ais/colorfx.qm"deleted file mode 100644index 63480bb27..000000000Binary files "a/stuff/config/loc/Fran\303\247ais/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/Fran\303\247ais/tnzcore.qm" "b/stuff/config/loc/Fran\303\247ais/tnzcore.qm"deleted file mode 100644index 172b2b963..000000000Binary files "a/stuff/config/loc/Fran\303\247ais/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/Fran\303\247ais/tnztools.qm" "b/stuff/config/loc/Fran\303\247ais/tnztools.qm"deleted file mode 100644index 98808b183..000000000Binary files "a/stuff/config/loc/Fran\303\247ais/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/Fran\303\247ais/toonz.qm" "b/stuff/config/loc/Fran\303\247ais/toonz.qm"deleted file mode 100644index db490e33e..000000000Binary files "a/stuff/config/loc/Fran\303\247ais/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/Fran\303\247ais/toonzlib.qm" "b/stuff/config/loc/Fran\303\247ais/toonzlib.qm"deleted file mode 100644index cf5148be0..000000000Binary files "a/stuff/config/loc/Fran\303\247ais/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/Fran\303\247ais/toonzqt.qm" "b/stuff/config/loc/Fran\303\247ais/toonzqt.qm"deleted file mode 100644index 451d4c37c..000000000Binary files "a/stuff/config/loc/Fran\303\247ais/toonzqt.qm" and /dev/null differdiff --git a/stuff/config/loc/Italiano/colorfx.qm b/stuff/config/loc/Italiano/colorfx.qmdeleted file mode 100644index c88141832..000000000Binary files a/stuff/config/loc/Italiano/colorfx.qm and /dev/null differdiff --git a/stuff/config/loc/Italiano/tnzcore.qm b/stuff/config/loc/Italiano/tnzcore.qmdeleted file mode 100644index aaa6eb091..000000000Binary files a/stuff/config/loc/Italiano/tnzcore.qm and /dev/null differdiff --git a/stuff/config/loc/Italiano/tnztools.qm b/stuff/config/loc/Italiano/tnztools.qmdeleted file mode 100644index 8157deb28..000000000Binary files a/stuff/config/loc/Italiano/tnztools.qm and /dev/null differdiff --git a/stuff/config/loc/Italiano/toonz.qm b/stuff/config/loc/Italiano/toonz.qmdeleted file mode 100644index b0e51f641..000000000Binary files a/stuff/config/loc/Italiano/toonz.qm and /dev/null differdiff --git a/stuff/config/loc/Italiano/toonzlib.qm b/stuff/config/loc/Italiano/toonzlib.qmdeleted file mode 100644index e6745cc44..000000000Binary files a/stuff/config/loc/Italiano/toonzlib.qm and /dev/null differdiff --git a/stuff/config/loc/Italiano/toonzqt.qm b/stuff/config/loc/Italiano/toonzqt.qmdeleted file mode 100644index c4f291e36..000000000Binary files a/stuff/config/loc/Italiano/toonzqt.qm and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/colorfx.qm" "b/stuff/config/loc/\304\214e\305\241tina/colorfx.qm"deleted file mode 100644index 68d44fd6f..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/image.qm" "b/stuff/config/loc/\304\214e\305\241tina/image.qm"deleted file mode 100644index f0f27d870..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/image.qm" and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/tnzcore.qm" "b/stuff/config/loc/\304\214e\305\241tina/tnzcore.qm"deleted file mode 100644index 4844f921a..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/tnztools.qm" "b/stuff/config/loc/\304\214e\305\241tina/tnztools.qm"deleted file mode 100644index 264242ac7..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/toonz.qm" "b/stuff/config/loc/\304\214e\305\241tina/toonz.qm"deleted file mode 100644index 48f12323f..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/toonzlib.qm" "b/stuff/config/loc/\304\214e\305\241tina/toonzlib.qm"deleted file mode 100644index 1a2c150e6..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/\304\214e\305\241tina/toonzqt.qm" "b/stuff/config/loc/\304\214e\305\241tina/toonzqt.qm"deleted file mode 100644index 35a1656b3..000000000Binary files "a/stuff/config/loc/\304\214e\305\241tina/toonzqt.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/colorfx.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/colorfx.qm"deleted file mode 100644index b4ac9bef7..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/image.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/image.qm"deleted file mode 100644index 414fcd349..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/image.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/tnzcore.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/tnzcore.qm"deleted file mode 100644index 57907ab93..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/tnztools.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/tnztools.qm"deleted file mode 100644index ccc490d9c..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonz.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonz.qm"deleted file mode 100644index 49dfa8881..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonzlib.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonzlib.qm"deleted file mode 100644index fa57efb91..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonzqt.qm" "b/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonzqt.qm"deleted file mode 100644index 4211e8570..000000000Binary files "a/stuff/config/loc/\320\240\321\203\321\201\321\201\320\272\320\270\320\271/toonzqt.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/colorfx.qm" "b/stuff/config/loc/\344\270\255\346\226\207/colorfx.qm"deleted file mode 100644index c9fda9914..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/image.qm" "b/stuff/config/loc/\344\270\255\346\226\207/image.qm"deleted file mode 100644index 2578e2e00..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/image.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/tnzcore.qm" "b/stuff/config/loc/\344\270\255\346\226\207/tnzcore.qm"deleted file mode 100644index 9baf7ac69..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/tnztools.qm" "b/stuff/config/loc/\344\270\255\346\226\207/tnztools.qm"deleted file mode 100644index 822ee6a4c..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/toonz.qm" "b/stuff/config/loc/\344\270\255\346\226\207/toonz.qm"deleted file mode 100644index b84c5ed64..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/toonzlib.qm" "b/stuff/config/loc/\344\270\255\346\226\207/toonzlib.qm"deleted file mode 100644index 834daa986..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/\344\270\255\346\226\207/toonzqt.qm" "b/stuff/config/loc/\344\270\255\346\226\207/toonzqt.qm"deleted file mode 100644index ef47e5c32..000000000Binary files "a/stuff/config/loc/\344\270\255\346\226\207/toonzqt.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/colorfx.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/colorfx.qm"deleted file mode 100644index 464676ad9..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/image.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/image.qm"deleted file mode 100644index 9d53629ed..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/image.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/tnzcore.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/tnzcore.qm"deleted file mode 100644index 68108932f..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/tnztools.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/tnztools.qm"deleted file mode 100644index 964e9c867..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm"deleted file mode 100644index 15095e626..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzlib.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzlib.qm"deleted file mode 100644index f601ac49d..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm"deleted file mode 100644index 82fddc84b..000000000Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/colorfx.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/colorfx.qm"deleted file mode 100644index dc6579d15..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/colorfx.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/image.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/image.qm"deleted file mode 100644index 5e837bc73..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/image.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/tnzcore.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/tnzcore.qm"deleted file mode 100644index eaab03dcb..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/tnzcore.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/tnztools.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/tnztools.qm"deleted file mode 100644index a857c5c5a..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/tnztools.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonz.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonz.qm"deleted file mode 100644index 060083dc3..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonz.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonzlib.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonzlib.qm"deleted file mode 100644index ad34f0669..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonzlib.qm" and /dev/null differdiff --git "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonzqt.qm" "b/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonzqt.qm"deleted file mode 100644index 2cf8c8d4c..000000000Binary files "a/stuff/config/loc/\355\225\234\352\265\255\354\226\264/toonzqt.qm" and /dev/null differdiff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txtindex 03056867d..bb4313717 100644--- a/toonz/sources/CMakeLists.txt+++ b/toonz/sources/CMakeLists.txt@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.10)set(CMAKE_BUILD_TYPE_INIT Release)-project(OpenToonz)-# Set C++17 globallyset(CMAKE_CXX_STANDARD 17)set(CMAKE_CXX_STANDARD_REQUIRED ON)message(STATUS "C++ standard: ${CMAKE_CXX_STANDARD}")+project(OpenToonz LANGUAGES C CXX)+#-----------------------------------------------------------------------------# Platform Specific Defaults@@ -299,7 +299,7 @@ find_package(Qt5 REQUIRED)if(NOT Qt5Core_FOUND)- message(FATAL_ERROR "Qt5Core not found—check paths")+ message(FATAL_ERROR "Qt5Core not found check paths")endif()message(STATUS "Qt5 Modules: ${Qt5Core_VERSION}")@@ -348,7 +348,7 @@ macro(_find_toonz_library OUT_LIB_LIST IN_LIB_LIST)set(OUTLIST "")foreach(arg ${IN_LIB_LIST})unset(COREPATH CACHE)- # find しても cmake が走るときにはできていないので完全なパス名を生成して返すだけ+ # Even if you try to find, CMake might not work properly, so we just generate and return the full pathif(BUILD_ENV_APPLE)set(LIBPATH "\$<TARGET_FILE:${arg}>")else()@@ -643,27 +643,122 @@ if(BUILD_ENV_MSVC AND MSVC_VERSION EQUAL 1800)add_compile_options("/wd4819")endif()+# =============================================================================+# Translation compilation (.ts -> .qm) and folder renaming+# =============================================================================if(WITH_TRANSLATION)- # generate Qt translations and messages- set(LANGUAGES japanese italian french spanish chinese german russian korean czech)+ # -------------------------------------------------------------------------+ # Dummy compatibility function+ # -------------------------------------------------------------------------function(add_translation module)- set(translation)- foreach(lang ${LANGUAGES})- set(name "${CMAKE_SOURCE_DIR}/translations/${lang}/${module}.ts")- list(APPEND translation ${name})- set_source_files_properties(${name} PROPERTIES- OUTPUT_LOCATION "${CMAKE_BINARY_DIR}/loc/${lang}"- )- endforeach()+ endfunction()- qt5_create_translation(message ${translation} ${ARGN})+ # ---------------------------------------------------------------------+ # Language data and display names+ # ---------------------------------------------------------------------+ set(LANG_CODES+ japanese italian french spanish chinese german russian korean czech+ )- add_custom_target("translation_${module}" DEPENDS ${message})- set_target_properties("translation_${module}" PROPERTIES- EXCLUDE_FROM_DEFAULT_BUILD TRUE- )+ set(LANG_DISPLAY_NAMES+ "日本語" "Italiano" "Français" "Español" "中文" "Deutsch" "Русский" "한국어" "Čeština"+ )++ list(LENGTH LANG_CODES CODE_COUNT)+ list(LENGTH LANG_DISPLAY_NAMES DISPLAY_COUNT)+ if(NOT CODE_COUNT EQUAL DISPLAY_COUNT)+ message(FATAL_ERROR "LANG_CODES and LANG_DISPLAY_NAMES must have the same length!")+ endif()++ # ---------------------------------------------------------------------+ # Compile .ts -> .qm+ # ---------------------------------------------------------------------+ function(compile_translations module)+ set(qm_files "")+ foreach(lang ${LANG_CODES})+ set(ts_file "${CMAKE_SOURCE_DIR}/translations/${lang}/${module}.ts")+ set(qm_dir "${CMAKE_BINARY_DIR}/../../stuff/config/loc/${lang}")+ set(qm_file "${qm_dir}/${module}.qm")++ # Ensure output directory exists at configure time (safe for parallel builds)+ file(MAKE_DIRECTORY "${qm_dir}")++ if(EXISTS "${ts_file}")+ add_custom_command(+ OUTPUT "${qm_file}"+ COMMAND ${Qt5_LRELEASE_EXECUTABLE} "${ts_file}" -qm "${qm_file}"+ DEPENDS "${ts_file}"+ COMMENT "lrelease ${lang}/${module}.qm"+ VERBATIM+ )+ list(APPEND qm_files "${qm_file}")+ endif()+ endforeach()++ if(qm_files)+ add_custom_target(translate_${module} ALL DEPENDS ${qm_files})+ endif()endfunction()++ # List of all modules that have translations+ set(TRANSLATION_MODULES+ toonz tnzcore toonzlib tnztools toonzqt image colorfx+ )++ foreach(mod ${TRANSLATION_MODULES})+ compile_translations(${mod})+ endforeach()++ # ---------------------------------------------------------------------+ # Rename language folders from code to native name (e.g. japanese → 日本語)+ # ---------------------------------------------------------------------+ set(LOC_ROOT "${CMAKE_BINARY_DIR}/../../stuff/config/loc")++ add_custom_target(rename_translation_folders ALL+ DEPENDS+ translate_toonz+ translate_tnzcore+ translate_toonzlib+ translate_tnztools+ translate_toonzqt+ translate_image+ translate_colorfx+ COMMENT "Renaming language folders to native display names"+ )++ # Generate the rename script (runs once per build)+ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/rename_languages.cmake" CONTENT+"set(LOC_ROOT \"${LOC_ROOT}\")+set(LANG_CODES ${LANG_CODES})+set(LANG_DISPLAY_NAMES ${LANG_DISPLAY_NAMES})++list(LENGTH LANG_CODES NUM_LANGS)+math(EXPR LAST_INDEX \"\${NUM_LANGS}-1\")++message(STATUS \"Renaming language folders to native display names...\")+foreach(idx RANGE 0 \${LAST_INDEX})+ list(GET LANG_CODES \${idx} src)+ list(GET LANG_DISPLAY_NAMES \${idx} dst)+ set(src_path \"\${LOC_ROOT}/\${src}\")+ set(dst_path \"\${LOC_ROOT}/\${dst}\")++ if(EXISTS \"\${src_path}\")+ if(EXISTS \"\${dst_path}\")+ file(REMOVE_RECURSE \"\${dst_path}\")+ endif()+ file(RENAME \"\${src_path}\" \"\${dst_path}\")+ message(STATUS \" => \${src}\")+ endif()+endforeach()+")++ # Execute rename after all .qm files are built+ add_custom_command(TARGET rename_translation_folders POST_BUILD+ COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/rename_languages.cmake"+ VERBATIM+ )+endif()set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS}")@@ -699,4 +794,4 @@ endif()if(BUILD_ENV_UNIXLIKE AND NOT BUILD_TARGET_WIN)add_subdirectory(xdg-data)-endif()+endif()\ No newline at end of file