How to create translation files (.ts) in our project from lupdate command?
-
Good evening, I am writing to you because I created a project and I wanted to translate it into English and Spanish languages. I made the modifications I had to make in my code to specify the functionalities to translate. Then I introduced in the .pro file of my project on QtCreator the following lines:
TRANSLATIONS +=
zeroclassgenerator_en.ts
zeroclassgenerator_es.ts \In the Qt command prompt I wrote:
lupdate "C:\Users\user\Documents\ZeroClassGenerator\ZeroClassGenerator.pro"
But I am told : Info: creating stash file C:\QtSdk2\6.2.1\mingw81_64.qmake.stash
lupdate warning: no TS files specified. Only diagnostics will be produced for 'C:/Users/user/Documents/ZeroClassGenerator/ZeroClassGenerator.pro'.In the end, the .ts files were not generated in my project. I don't know where my mistake is. Thank you in advance for your answers.
-
As described in the documentation you have to specify the ts file to update/create after the sources / pro-file which contains the sources
-
@gouneken the easiest will be, to skip the command line entirely.
You are using QtCreator, at least you said so, select
Tools -> External -> update translationsmake sure you selected the correct kit beforehand, for some reason, lupdate from android and iOS kits fail to generate any ts files, but the desktop kits work just fine.