PDA

View Full Version : How to apply the tr() macro to a label added with designer



franco.amato
19th October 2010, 00:13
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

wysota
19th October 2010, 00:19
All user visible strings generated by Designer are already wrapped into tr() calls. This is of course well documented in the reference.

franco.amato
19th October 2010, 00:25
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 5359.
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

wysota
19th October 2010, 00:36
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?

franco.amato
19th October 2010, 00:42
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?

wysota
19th October 2010, 00:47
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.

franco.amato
19th October 2010, 00:50
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

wysota
19th October 2010, 00:56
Internationalization - step by step

franco.amato
19th October 2010, 01:07
Internationalization - step by step

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

wysota
19th October 2010, 01:12
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.

franco.amato
19th October 2010, 01:18
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

wysota
19th October 2010, 01:25
Because function 'eval' is not implemented.