views:

208

answers:

1

I have a large project with one qmake project file defining all project components using a 'subdirs' template. Currently I define translation files in the qmake files of each sub-project. This results in separate translation files for each sub-project, which quickly becomes too cumbersome to maintain.

How do I get lupdate to produce a single translation file containing all translation strings for all of the sub-projects?

+2  A: 

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

Special language pro file looks like this:

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.

TimW
I'm not sure what should end up in the .pri files and what should end up in the .pro files?
Ton van den Heuvel
I just tried your solution assuming I need to specify only the SOURCES, HEADERS, and FORMS in the .pri file, and it works! Thanks for your answer.
Ton van den Heuvel