Home · Examples 


Qt Linguist Manual: Release Manager

[Qt Linguist Manual][Next: Qt Linguist Manual: Translators]

Two tools are provided for the release manager, lupdate and lrelease. We take a closer look at them in the following sections.

lupdate

Usage: lupdate [options] [source-file|path]... -ts ts-files

lupdate is a command line tool that finds the translatable strings in the specified source, header and Qt Designer interface files, and produces or updates .ts translation files. The files to process and the files to update is set at the command line. The produced translation files are given to the translator who uses Qt Linguist to read the files and insert the translations.

Companies that have their own translators in-house may find it useful to run lupdate regularly, perhaps monthly, as the application develops. This will lead to a fairly low volume of translation work spread evenly over the life of the project and will allow the translators to support a number of projects simultaneously.

Companies that hire in translators as required may prefer to run lupdate only a few times in the application's life cycle, the first time might be just before the first test phase. This will provide the translator with a substantial single block of work and any bugs that the translator detects may easily be included with those found during the initial test phase. The second and any subsequent lupdate runs would probably take place during the final beta phase.

The .ts file format is a simple human-readable XML format that can be used with version control systems if required. lupdate can also process Localization Interchange File Format (XLIFF) format files; file in this format typically have file names that end with the .xlf suffix.

Pass the -help option to lupdate to obtain the list of supported options:

    Usage:
        lupdate [options] [source-file|path]... -ts ts-files
    Options:
        -help  Display this information and exit.
        -noobsolete
               Drop all obsolete strings.
        -extensions <ext>[,<ext>]...
               Process files with the given extensions only.
               The extension list must be separated with commas, not with whitespace.
               Default: 'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.
        -silent
               Don't explain what is being done.
        -version
               Display the version of lupdate and exit.
Qt Linguist is also able to import and export XLIFF files. See the
Translators section for more information.

lrelease

Usage: lrelease [options] ts-files [-qm qm-file]

lrelease is a command line tool that produces .qm files out of .ts files. The .qm file format is a compact binary format that is used by the localized application. It provides extremely fast lookups for translations. The .ts files lrelease processes is specified at the command line.

This tool is run whenever a release of the application is to be made, from initial test version through to final release version. If the .qm files are not created, e.g. because an alpha release is required before any translation has been undertaken, the application will run perfectly well using the text the programmers placed in the source files. Once the .qm files are available the application will detect them and use them automatically.

Note that lrelease will only incorporate translations that are marked as "finished". Otherwise the original text will be used instead.

Pass the -help option to lrelease to obtain the list of supported options:

        Usage:
            lrelease [options] ts-files [-qm qm-file]
        Options:
            -help  Display this information and exit
            -compress
                   Compress the .qm files
            -nounfinished
                   Do not include unfinished translations
            -silent
                   Don't explain what is being done
            -version
                   Display the version of lrelease and exit

Missing Translations

Both lupdate and lrelease may be used with .ts translation source files which are incomplete. Missing translations will be replaced with the native language phrases at runtime.


Copyright © 2009 Nokia Trademarks
Qt Jambi 4.5.2_01