How to use the QtLinguist, easy way?
-
Have you navigated to the build directory of the project (displayed in Qt Creator under Projects > Build Settings > Build Directory)?
Anyhow, if you don't feel confident on the command line, you can also trigger the target from within Qt Creator: Press Ctrl+K (to open the navigator), and then type
cm <my project name>_lupdate
-
-
@Artem-Shapovalov said in How to use the QtLinguist, easy way?:
@kkoehne I checked this feature and it's don't build unknown targets.
THat's weird. If the target is 'unknown', then it doesn't exist in CMake, I'd claim.
@kkoehne , @jsulm , thank you guys, I explore a little bit more, but I decided to use
another internationalization tool. Maybe later I would return to this Qt feature.Out of interest: Which tool are you going for?
-
@kkoehne now I'm fighting with this. just ported all my apps from 5.15 to 6.6 using QMake.
Now as next step: port from QMake to CMake
BTW: doing it all from inside QtCreator, no cmdline
all my apps rely on translations and this works well in 5.15/QMake:
changed strings - build project - external cmd lupdate - QtLinguist - extrernal cmd lrelease
External commands don't work as reported here.
tried with QtCreator Linguist Example arrowpadqt6_add_translations(arrowpad TS_FILES arrowpad_fr.ts arrowpad_nl.ts QM_FILES_OUTPUT_VARIABLE qm_files) install(FILES ${qm_files} DESTINATION ${INSTALL_EXAMPLEDIR})
added arrowpad_de.ts, saved CMakeLists.txt and the file was created.
build the project, but all .ts files are empty
tried your recommendation:cm arrowpad_lupdate
doesnt work. while typing (macOS) Cmd-Kcm arrowpad there's only arrowpad_lrelease listed but no arrowpad_lupdate
any idea ? -
@ekkescorner , have you actually tried running
cm arrowpad_lupdate
from Qt Creator? For me the command never shows up in autocomplete (which needs to be studied, created https://bugreports.qt.io/browse/QTCREATORBUG-29946), but I can run it, with Qt 6.6.0.
-
@kkoehne aaah. typing it it's working. was confused because autocomplete missed it.
THX - no I can go on to the next CMake features :) -
I was struggling with the same issue and I landed here. It helped. Now, I made the following changes to my cmake script to make it seamless.
add_custom_target(run_app_lupdate
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target app_lupdate
COMMENT "Running app_lupdate"
)
add_dependencies(app run_app_lupdate)Here "app' is the traget name
-
you don't need this. Qt 6.7 / QtC 13.0:
there are automatically generated targets there, you can execute:
update_translations
release_translations