The QT library is very good in internationalization and localization, and it is very convenient to use the software developed by QT for the multi-language version of the software.
Generally, in programming, the qobject: TR function is used to enclose all strings. In this way, it is easy to use linguist to export English text and create translation files, then, as long as qtranslator is used in the appropriate part of the program to load the required translation file, and then qapp-> installtranslator () is called, the program naturally replaces the interface of another language.
However, many new users will find another problem, that is, by right-clicking in the text box, not the expected Chinese menu, but the English menu, when a file is opened or the general filedialog of the directory is selected, the information and button text are displayed in English. How can we convert English in these places into appropriate texts ???
In fact, QT has done a good job for you. There is a translation directory in the QT Directory, which contains a lot of translation files that have been prepared, as long as the corresponding translation files (*. (QM) use a new qtranslator to load the translation file and then call qapp-> installtranslator (). Then you will find that the right-click menu and general-purpose dialog box are all in Chinese.