Alex Rivera | Logout

How to integrate QT internationalization to CMake?

Asked 2011-04-12T03:42:13.050
20

Greetings all,

I am trying to use QT internationalization with CMake. I have configured my cmake file as follows :

#Internalization - this should generate core_jp.ts ?
SET(rinzo_core_TRANSLATIONS
   i18n/core_jp.ts
   )

#these are my source files in the project
SET(FILES_TO_TRANSLATE
   ${rinzo_core_srcs} 
   ${rinzo_core_moh_srcs}
 )

QT4_CREATE_TRANSLATION(QM_FILES ${FILES_TO_TRANSLATE} ${rinzo_core_TRANSLATIONS})
QT4_ADD_TRANSLATION(QM ${rinzo_core_TRANSLATIONS})

But it doesnt genereate any TS nor QM files.

My questions -

1.Does Cmake(by using QT tools) generate TS files automatically extracting "tr()" methods from the source ? (that means I dont have to create any TS file and above i18n/core_jp.ts will be genereated automatically)

2.What exacly are QM files ?

Thanks in advance

Edit
Report

1 Answer

4

Translation binary files (*.qm) according to http://itk.org/Wiki/CMake:How_To_Build_Qt4_Software

Also from the bottom of that website

Usage - Updating the .ts files

When you want it to process all your source files (looking for new texts to translate), configure cmake to turn on UPDATE_TRANSLATIONS, and then make your project. CMake will modify your .ts files in your SOURCE folders in addition to generating the .qm files. WARNING: Be aware that CMake will be updating the source .ts files, which means that if > you do a make clean, it will DELETE your source .ts files!!! So it would be a good idea > to switch off UPDATE_TRANSLATIONS as soon as possible.

answered 2011-04-12T10:03:44.373

Your Answer