Results 1 to 3 of 3

Thread: tr() use

  1. #1
    Join Date
    Jun 2013
    Location
    Bangalore
    Posts
    27
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    7

    Default tr() use

    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.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Wiki edits
    15

    Default Re: tr() use

    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.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. The following user says thank you to Santosh Reddy for this useful post:

    prasad.ece2 (9th December 2013)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: tr() use

    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,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    prasad.ece2 (9th December 2013)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.