Results 1 to 12 of 12

Thread: How to apply the tr() macro to a label added with designer

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to apply the tr() macro to a label added with designer

    Hi,
    I trying to implement 'translation' to some labels of my project.
    So I'm wrapping every label with the tr() macro to apply lupdate in a second moment.
    My doubt is how can I do it with the labels added with the designer?

    Regards
    Franco Amato

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to apply the tr() macro to a label added with designer

    All user visible strings generated by Designer are already wrapped into tr() calls. This is of course well documented in the reference.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to apply the tr() macro to a label added with designer

    Quote Originally Posted by wysota View Post
    All user visible strings generated by Designer are already wrapped into tr() calls.
    Thank you very much.
    I gave
    lupdate -verbose myprofile.pro
    and I got many errors as in the screenshot I'm attaching lupdate.jpg.
    Where are my mistakes?

    I copy here the shell output as it's not well visible in the image

    C:\dev\ECP_Studio>lupdate -verbose ECP_Studio.pro
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(66):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(69):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(72):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(75):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(78):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(80):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(82):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(84):Function 'eval' is not im
    plemented
    lupdate warning: no TS files specified. Only diagnostics will be produced for 'E
    CP_Studio.pro'.
    C:/Qt/4.6.3/src/corelib/tools/qstringbuilder.h:45: circular inclusion of c:/Qt/4
    .6.3/include/QtCore/qstring.h

    C:/Qt/4.6.3/src/gui/painting/qwmatrix.h:45: circular inclusion of c:/Qt/4.6.3/in
    clude/QtGui/qmatrix.h

    c:/Qt/4.6.3/include/QtGui/qboxlayout.h:1: circular inclusion of C:/Qt/4.6.3/src/
    gui/kernel/qboxlayout.h

    C:/Qt/4.6.3/src/gui/kernel/qgridlayout.h:45: circular inclusion of c:/Qt/4.6.3/i
    nclude/QtGui/qlayout.h

    C:/Qt/4.6.3/src/gui/kernel/qactiongroup.h:45: circular inclusion of c:/Qt/4.6.3/
    include/QtGui/qaction.h
    Regards
    Last edited by franco.amato; 18th October 2010 at 23:32.
    Franco Amato

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to apply the tr() macro to a label added with designer

    You remembered about adding translation entries in the project file, right? You do know the process of translating your application is explained in the docs, correct?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to apply the tr() macro to a label added with designer

    Quote Originally Posted by wysota View Post
    You remembered about adding translation entries in the project file, right? You do know the process of translating your application is explained in the docs, correct?
    it should be so:
    1) wrap every string with tr() macro
    2) call lupdate in the files
    3) translate the string with linguist
    4) add TRANSLATION entry to the pro file with the files produced by linguist.

    Maybe I'm wrong?
    Franco Amato

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to apply the tr() macro to a label added with designer

    Yes, you are wrong. There is a "step by step" procedure described in the docs, just follow it. Pay speciall attention about the order of doing things.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to apply the tr() macro to a label added with designer

    Quote Originally Posted by wysota View Post
    Yes, you are wrong. There is a "step by step" procedure described in the docs, just follow it. Pay speciall attention about the order of doing things.
    I'm following the step by step mentioned by you and seems the 1 and 2 are as above so why I'm getting that errors?

    Regards
    Last edited by franco.amato; 18th October 2010 at 23:55.
    Franco Amato

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to apply the tr() macro to a label added with designer

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to apply the tr() macro to a label added with designer

    Quote Originally Posted by wysota View Post
    Ok I found one of my mistakes. I forgot to add the entries in the pro file before callung lupdate,
    but I'm still getting some strange errors ( and this time I don't think it's for my mistake ).

    Here the shell output:
    C:\dev\ECP_Studio>lupdate -verbose ECP_Studio.pro
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(66):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(69):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(72):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(75):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(78):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(80):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(82):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/mkspecs/features/debug_and_release.prf(84):Function 'eval' is not im
    plemented
    C:/Qt/4.6.3/src/corelib/tools/qstringbuilder.h:45: circular inclusion of c:/Qt/4
    .6.3/include/QtCore/qstring.h

    C:/Qt/4.6.3/src/gui/painting/qwmatrix.h:45: circular inclusion of c:/Qt/4.6.3/in
    clude/QtGui/qmatrix.h

    c:/Qt/4.6.3/include/QtGui/qboxlayout.h:1: circular inclusion of C:/Qt/4.6.3/src/
    gui/kernel/qboxlayout.h

    C:/Qt/4.6.3/src/gui/kernel/qgridlayout.h:45: circular inclusion of c:/Qt/4.6.3/i
    nclude/QtGui/qlayout.h

    C:/Qt/4.6.3/src/gui/kernel/qactiongroup.h:45: circular inclusion of c:/Qt/4.6.3/
    include/QtGui/qaction.h

    Updating 'ecpstudio_en.ts'...
    Found 91 source text(s) (91 new and 0 already existing)
    Updating 'ecpstudio_it.ts'...
    Found 91 source text(s) (91 new and 0 already existing)
    What does mean
    Function 'eval' is not implemented
    Regards
    Franco Amato

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to apply the tr() macro to a label added with designer

    These are all warnings, you don't need to worry about them. Remove the -verbose parameter from lupdate call and they will probably go away.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to apply the tr() macro to a label added with designer

    Quote Originally Posted by wysota View Post
    These are all warnings, you don't need to worry about them. Remove the -verbose parameter from lupdate call and they will probably go away.
    Yes I agree with you, but warning normally is something that's not ok.
    I would know why I'm getting such warnings
    Franco Amato

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to apply the tr() macro to a label added with designer

    Because function 'eval' is not implemented.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to change Label text colour in Qt designer
    By sudhansu in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2010, 12:31
  2. Designer crashes with any plugin added
    By newqtuser in forum Qt Tools
    Replies: 2
    Last Post: 25th November 2008, 14:39
  3. Q_OBJECT macro - what exactly does it do?
    By magland in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:30
  4. Macro
    By comlink21 in forum Qt Programming
    Replies: 1
    Last Post: 25th July 2007, 11:28
  5. Macro used for debugging
    By sunil.thaha in forum General Programming
    Replies: 11
    Last Post: 30th March 2007, 17:32

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.