Results 1 to 5 of 5

Thread: translation issues

  1. #1
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default translation issues

    hi ,

    I have an applications which is in french. and I was able to translate the UI texts into english. but unable to translate the code within the file which is in form of strings using tr(). i searched and got an idea that i can add integer to TR function how it is? and convert to french or should i use qtTrId functions.


    any one can suggest .

    Thanks in advance

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

    Default Re: translation issues

    I am not sure what you mean.

    If you have translatable text in C++ code, you pass it through the tr() function.
    That serves as a translation call during runtime as well as marking the string for extraction for the lupdate tool.

    Cheers,
    _

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

    kulsekarr (3rd February 2015)

  4. #3
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: translation issues

    thanks for your reply actually i have defined the error messages in tr(). and there are hundreds of messages that will repeat. so i thought of adding a header file with all the error messages defined to a varaible.

    errorcode.h
    ex #define ERROR_1 "CORRECT IT"

    actualcode.cpp
    and i am using the tr() as-----> msgBox.setText(tr(ERROR_1)); while im

    whether it is possible to implement?

    Thanks

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

    Default Re: translation issues

    Ah.

    Yes, you can do something like that, but you need to mark the strings for translation using QT_TRANSLATION_NOOP
    http://qt-project.org/doc/qt-4.8/lin...translate-noop

    Cheers,
    _

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

    kulsekarr (4th February 2015)

  7. #5
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: translation issues

    Thanks!! Got It!

Similar Threads

  1. UI translation
    By Annihilator in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2010, 11:37
  2. translation
    By weixj2003ld in forum Qt Programming
    Replies: 8
    Last Post: 31st May 2010, 01:01
  3. Translation issues
    By Auliyaa in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2010, 15:14
  4. Translation of UI
    By elizabeth.h1 in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2009, 11:01
  5. Translation
    By merlvingian in forum Qt Programming
    Replies: 1
    Last Post: 14th August 2007, 17:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.