View Single Post
Posts: 19 | Thanked: 2 times | Joined on Jun 2010
#61
Thanks for looking into this Mohannad.

Originally Posted by mohannad View Post
Thank you for your offer! Umm, do you have the Qt SDK installed? My next task is to get translations working.. Ive had one crack at it before and couldnt figure out how it works, are you able to help me out with this please?
Unfortunately, not yet. Since I don't have a linux machine nearby I tried to get the SDK virtual image. For some reason, it is offline for sometime now. I'll try to see if I can find out if it'll be back online.

I had a look at Qt localization from http://doc.qt.nokia.com/qt-maemo-4.6...alization.html and http://doc.qt.nokia.com/qt-maemo-4.6...anslation.html
It is a bit confusing, but if I understand correctly,
1. you need to pass tr("hard coded string") instead of "hard coded string" for all strings in your source.
2. you also need to add supported localizations to your project file (very simple. Just file names like mPrayerTime_ar.ts).
3. you need to use the "lupdate" command line tool to process the project file and generate the source localization files mentioned in it (like mPrayerTime_ar.ts). These auto-generated files are xml files. lupdate parses all source files in your project and adds all strings inside tr() into the *.ts files. Strings not covered by tr() will not be translated.
4. use the "linguist" graphical tool to open these translation source files (*.ts) and translate the strings into the target languages then save the files again.
5. use the "lrelease" command line tool to pack the translation source files into binary *.qm files that are used by Qt at runtime for translations.

I'll try to get the virtual image and test this. Meanwhile, you can either move into something else or have a second attempt using Qt internationalization