In this section, you will learn how to create applications that support multiple languages using the Qt framework. In fact, it all comes down to a single class that is extremely easy to use. The QTranslator class is the main Qt class responsible for handling internationalization of output (displayed) text. You simply need to make sure of the following:
- Use a default language (English, for instance) while you are building your project. This means, simply use sentences and words in the default language for everything that is displayed.
- Make sure all literal sentences in your code, or to be specific, all literal sentences that need to be translated when a different language is selected are embraced in a tr() function.
For example, in the code, if you need to write a literal sentence such as Open Input Image (as we did in the Hello_Qt_OpenCV...