PDA

View Full Version : tr() use



prasad.ece2
9th December 2013, 12:02
hi i am new to Qt, i came across use of tr() function no.of times, what is the use of this function, i went through the documentation i am not able to get it exactly.
can any one tell me what exactly it is and when we have to use this.

thanks in Advance.

Santosh Reddy
9th December 2013, 13:10
can any one tell me what exactly it is
It translates the give text to the currently selected language settings. Note that when the language selection is changed, this function's output will also change (provided it is called called again) based on the language translations availability.


and when we have to use this.
You have use this, when the application have to support multiple languages.

anda_skoa
9th December 2013, 14:28
The Qt documentation has some examples which show the translation system in action:
http://qt-project.org/doc/qt-4.8/linguist-hellotr.html
http://qt-project.org/doc/qt-4.8/tools-i18n.html

Cheers,
_