Results 1 to 20 of 25

Thread: How to tranlaste #define and text from file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: How to tranlaste #define and text from file

    maybe a stupid question, but why translate the QDialogButtonBox strings again?

    Those strings from Qt should already be translate for Qt.
    If they aren't, maybe the Qt translation catalogue wasn't loaded?
    See http://qt-project.org/doc/qt-4.8/i18...ng-translation

    Cheers,
    _

  2. #2
    Join Date
    May 2013
    Posts
    45
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    11

    Default Re: How to tranlaste #define and text from file

    when i am erased .ts file and create new, QT_TRANSLATE_NOOP works ok

    this

    const char * const TEXT_TO_TRANSLATE = QT_TRANSLATE_NOOP("translateCategory", "translate");
    ui.label_2->setText(QApplication::translate("translateCategor y",TEXT_TO_TRANSLATE));

    and this

    const char * const TEXT_TO_TRANSLATE = QT_TRANSLATE_NOOP("QObject", "translate");
    ui.label_2->setText(QObject::tr(TEXT_TO_TRANSLATE));

    booth work.



    or best for this example

    const char * const TEXT_TO_TRANSLATE = QT_TRANSLATE_NOOP("MainWindow", "translate");
    ui.label_2->setText(tr(TEXT_TO_TRANSLATE));

    work too.
    Last edited by stevocz; 17th December 2013 at 14:28.

Similar Threads

  1. How to define a string marco in pro file
    By jevonwang in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 6th May 2013, 05:49
  2. QMake how to define install target of lib in the .pro file
    By thgis in forum Qt Tools
    Replies: 1
    Last Post: 15th April 2013, 12:59
  3. How to define a string in a .pro file
    By ChristineD in forum Newbie
    Replies: 4
    Last Post: 16th October 2012, 17:14
  4. qmake rc file define version
    By cafu1007 in forum Qt Programming
    Replies: 3
    Last Post: 26th January 2012, 16:38
  5. Replies: 1
    Last Post: 3rd September 2008, 14:16

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.