Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a single translation file for a large Qt project?

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?

like image 628
Ton van den Heuvel Avatar asked Dec 01 '09 22:12

Ton van den Heuvel


People also ask

What is Qt Linguist?

Qt Linguist is a tool for adding translations to Qt applications. Once you have installed Qt, you can start Qt Linguist in the same way as any other application on the development host.


1 Answers

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.

like image 68
TimW Avatar answered Apr 28 '23 11:04

TimW