how can i start creating a ts file that my application will use?
in the options of Linguist i can't create a new one with my own words and translation.... i can only translate a ts file that is allready exist.
how can i start creating a ts file that my application will use?
in the options of Linguist i can't create a new one with my own words and translation.... i can only translate a ts file that is allready exist.
First, in your project, you need to write texts with tr() if you wanna translate them. For example
In your pro file, add
These files will be created automatically later.
Second, go to Qt Command Prompt. Go to your project directory from command prompt. Then, write
and press enter key. It will automatically create "ts" files
("chinese.ts" and "italian.ts")
for you.After that, you need to open Qt Linguist and open your "ts" file. Add translation for your project. When you finish it, release it to get "qm" file.
When you want to translate your application, load the "qm" file.
I think this can be done by the qt command line tool lupdate.
It will scan your code for strings you marked as translatable (tr() macro) and collect them in a *.ts file.
See the documentation for more information.