IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

qt_add_translation

Compiles Qt Linguist .ts files into .qm files.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

qt_add_translation

 

Synopsis

 
Sélectionnez
qt_add_translation(<VAR> file1.ts [file2.ts ...]
                    [OPTIONS ...])

qt6_add_translation(<VAR> file1.ts [file2.ts ...]
                    [OPTIONS ...])

Description

Calls lrelease on each .ts file passed as an argument, generating .qm files. The paths of the generated files are added to <VAR>.

Options

You can set additional OPTIONS that should be passed when lrelease is invoked. You can find possible options in the lrelease documentation.

By default, the qm files will be placed in the root level of the build directory. To change this, you can set OUTPUT_LOCATION as a property of the source .ts file.

Examples

Generating helloworld_en.qm, helloworld_de.qm in the build directory:

 
Sélectionnez
qt_add_translation(qmFiles helloworld_en.ts helloworld_de.ts)

Generating helloworld_en.qm, helloworld_de.qm in a l10n sub-directory:

 
Sélectionnez
set(TS_FILES helloworld_en.ts helloworld_de.ts)
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "l10n")
qt_add_translation(qmFiles ${TS_FILES})

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+