Ubuntu: i18n vs qsTr (what is the difference)



Question:

In this tutorial http://developer.ubuntu.com/resources/tutorials/getting-started/currency-converter-phone-app/ you can see i18n.tr was used for the internationalisation of text in the Qml file. Today I checked this tutorial: http://qt-project.org/doc/qt-5.0/qtquick/qtquick-internationalization.html where they use another technique (qsTr).

What is the difference between the two? What makes one better than the other in some situations?


Solution:1

The qsTr() method uses the standard Qt translations support, which is not using gettext. The i18n.tr() method is from the Ubuntu SDK and is a wrapper around gettext. Many internationalization features in Ubuntu, and Linux distributions in general, are built around the GNU gettext system, and so using it provides the ability to use more tools and integrate better with other parts of the system, while the Qt translations system is specific to Qt.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »