diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 50980bfb262..2acb07f03c0 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -15,9 +15,7 @@ CheckOptions: file(GLOB tss "*.ts") QT_WRAP_UI(uis_hdrs ${uis}) QT_ADD_RESOURCES(resources "gui.qrc") - # TODO: passing "-no-obsolete" here breaks the translations - QT_CREATE_TRANSLATION(qms ${CMAKE_CURRENT_SOURCE_DIR} ${tss}) - list(APPEND cppcheck-gui-deps ${hdrs} ${uis_hdrs} ${resources} ${qms}) + list(APPEND cppcheck-gui-deps ${hdrs} ${uis_hdrs} ${resources}) add_custom_target(gui-build-deps SOURCES ${cppcheck-gui-deps}) list(APPEND cppcheck-gui_SOURCES ${srcs}) @@ -27,6 +25,10 @@ CheckOptions: add_executable(cppcheck-gui ${cppcheck-gui-deps} ${cppcheck-gui_SOURCES}) target_link_libraries(cppcheck-gui cppcheck-core simplecpp tinyxml2 picojson frontend) + qt_add_translations(cppcheck-gui + TS_FILES ${tss} + QM_FILES_OUTPUT_VARIABLE qms) + add_dependencies(cppcheck-gui release_translations) set_target_properties(cppcheck-gui PROPERTIES AUTOMOC ON) set_target_properties(cppcheck-gui PROPERTIES WIN32_EXECUTABLE ON) diff --git a/gui/readme.txt b/gui/readme.txt index 2137c6d174d..5983fe3658f 100644 --- a/gui/readme.txt +++ b/gui/readme.txt @@ -45,7 +45,11 @@ has several options to select tests etc. You can get the help by running Translations ------------ The GUI is translated to several languages. Qt comes with two tools to update -and compile the translations. lupdate updates translations files from the code -and lrelease compiles translation files use with the executable. - -The translations are automatically updated and compiled within CMake. \ No newline at end of file +and compile the translations. + +1. lupdate updates translations files from the code. + Updating the translation files from the code is a separate step: run + "lupdate gui.pro" + in the gui directory. +2. lrelease compiles translation files use with the executable. + The translations are automatically compiled within CMake.