Localizing applications with Qt is easy with Qt Linguist and the localization framework in Qt. To use the framework, though, you must mark your strings to localize with tr or qsTr in your source code wherever they appear. Once you do this, you can create a source file of strings to translate with QLinguist using Qt's lupdate command and then provide translations for each string. Once you've provided the translations, you compile them using lrelease and then include them in your application by installing a QTranslator object in your application's main function and by loading the translation table generated by lrelease.
In this chapter, we have learned how to mark translatable texts so that Qt knows which text needs to be localized. Next, we also learned how to export these texts using Qt Linguist into a list that can be easily edited by you and your translator...