How to create a separate translation file for a large Qt project?

I have a large project with one qmake project file defining all project components using the 'subdirs' template. I am currently defining translation files in the qmake files of each subproject. This leads to separate translation files for each subproject, which quickly becomes too cumbersome to maintain.

How to get lupdate to create a single translation file containing all translation lines for all subprojects?

+4
source share
1 answer

First of all, split all your pro files into pro and pri files. Then put all the pri files in one global pro file and generate the language file for this pro file.

The special pro pro file is as follows:

TEMPLATE = app DEPENDPATH += Proj1 Proj2 Proj3 include(Proj1/Proj1.pri) include(Proj2/Proj2.pri) include(Proj3/Proj3.pri) TRANSLATIONS = en.ts fr.ts it.main.ts ja.main.ts nl.main.ts 

A script can easily generate this project language file for you.

+5
source

All Articles