Generating a Translation (.ts) File


Qt provides tools for generating translation files. This is discussed both with Qt's documentation and in other documents for xTuple. Because of the way the project files are organized it is not obvious on how to use Qt's lupdate tool to create or update a translation file. This document briefly discusses the steps to overcome this. There are still some potential problems, foremost that openrpt is not included in the translation.

To start we need to generate a project file that lupdate can use to process the code. This file must include all the source files in one project file and since this can change over time it is best and easy to generate the file when needed. To generate the file you may use qmake. The following command generates a project file that is usable for our needs and should be run in the projects top level directory, xtuple for example.

qmake -project -o

Now that we have a project file called we can run lupdate to update all the existing translation files that are in the code directories. If you want to add a new file you can edit the file and add the required files to the list at the bottom of the project file.