5 Basic steps of Qt - Translation


1. Add following to .pro file

TRANSLATIONS = some_name.ts

and Install a translator

QApplication app(argc, argv);
QTranslator translator; 
translator.load("some_name"); 
app.installTranslator(&translator);

2. lupdate *.pro

This Produces *.ts file.


3. Open *.ts file in linguist , enter translation strings for the desired source texts.


4. lrelease *.pro

This produces *.qm file


5. Make sure, the executable can find qm file.

Just drop it to the same folder where exe resides.


Example : To demonstrate multiple languages and dynamic changes on different uis.

No comments:

Post a Comment