Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
alejandroh
Posts: 13
Registered: ‎11-30-2012
My Device: Alpha

lupdate doesn't translate tr() string

I have a multi language app. There is no problem with qsTr in QML. Messages are created in the ts files.

The problem is with the c++ tr() function. No messages are included into the ts file.

 

I have try including the cpp files into de lupdate_inclusion

lupdate_inclusion {
    SOURCES += $$BASEDIR/../assets/*.qml \
    		$$BASEDIR/src/*.cpp
}

 Also y have try inserting a Meta-Data string with the //= comment before the tr() function like in http://developer.blackberry.com/cascades/reference/i18n-source-translation.html , but there is no solution.

 

Any help?

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: lupdate doesn't translate tr() string

i have my cpp files only in the SOURCES+= section of the pro file, the lupdate_inclusion only has the different qml folders and subfolders.

i would suggest that you check if all folders and subfolders are in your HEADERS and SOURCE declaration.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
alejandroh
Posts: 13
Registered: ‎11-30-2012
My Device: Alpha

Re: lupdate doesn't translate tr() string

Yes, all HEADERS and SOURCES declarations are ok. My code is working ok. What it not working is the tr translations in C++

New Developer
luislobo
Posts: 5
Registered: ‎07-21-2009
My Device: Not Specified

Re: lupdate doesn't translate tr() string

Same situation here.

 

I'm using QNX® Momentics® IDE for BlackBerry® 10 Native SDK

Version: 10.0.9
Build id: v201212072306

(c) Copyright QNX Software Systems Limited 2002-2012.  All rights reserved.
Visit http://www.qnx.com/


Developer
tommy20
Posts: 262
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: lupdate doesn't translate tr() string

Any thoughts on this problem?
--tom
Developer
helex
Posts: 293
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook

Re: lupdate doesn't translate tr() string

[ Edited ]

I've at the moment the same problem. No idea so far. :smileysad:

 

Edit: Got my problem solved, the \ after each line was missing. So the inclusion worked only for the first line. Hope this helps others as well.