CopperSpice API  1.9.2
Linguist lupdate Application

Running the lupdate application creates a new translation file or updates existing translation files. The changes to a TS file are based on the strings which are marked for translation in the source code.

The lupdate program scans all of your source code for calls to QObject::tr(), QCoreApplication::translate, and the functions cs_mark_tr(), cs_mark_string_tr(), and qtTrId(). The strings which are used in these calls will be stored in the translation file along with a blank entry for the eventual translation text.

For more information refer to Using tr() to Mark Translations

lupdate

The lupdate application is a command line program which extracts the marked translatable strings from your source code, header files and UI designer files. It produces or updates the TS translation file which is a simple readable XML format.

There are multiple parameters which can be passed to lupdate. To see a complete list of supported options pass -help.

Usage

The command shown below is a typical example for running lupdate. The last parameter will create new TS files if none exist or update existing TS files if they are present. The TS files will be located in the resources folder.

lupdate -locations absolute -no-obsolete -recursive src build/src -ts resources/myApp_[de,fr,ru].ts

The other options will modify what lupdate adds to the TS file output.

-locations absolute
Save the source file name and line number where the translated text is located
-no-obsolete
Removes all strings in an existing TS file which is no longer present in the source code
-recursive src build/src
Searches recursively in the given directories for strings which were marked for translation