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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 17
Registered: ‎05-27-2011
My Device: Blackberry tablet

Best way to handling Text in BB10 apps

[ Edited ]

Hi All,

 

I am really interested to hear your guys opinion on the following.

What is the best way to handle your text in BB10 apps if you are building a whitelable app?

 

I built an app that uses QML for the UI and handles all the business logic and data handling through C++.

At the moment when I am setting my texts in QML I am using qsTr("something").

 

So my question being. If I want to make a whitelable app and I wanna be able to quickly change the Text.

Is there any sexy solution in BB10 something like Android does (String.xml)or something similar that early BB dev did? or a key value pair solution where just grab the key am after am think of something like the following

 

qsTr(MY_KEY)

 

so that way I can edit my text in one doc instead of screening through all the UI elements I built.

 

Any Ideas? Or could I just store them in a JS file or in raw txt or is there any more elegant solution?

 

I am keen to hear your guys thoughts.

Highlighted
Retired
Posts: 74
Registered: ‎07-22-2008
My Device: BlackBerry Z10
My Carrier: N/A

Re: Best way to handling Text in BB10 apps

Have you looked into Cascades localiztion APIs?  You can essentially store all your text in translation files and load them on the fly.  I don't know if this will exactly address your use case but definitely worth a look:

 

https://developer.blackberry.com/cascades/documentation/device_platform/internationalization/localiz...

 

Thanks,
Pratik Sapra
Gaming & Apps Consultant
Developer Relations
@pratiksapra
Contributor
Posts: 17
Registered: ‎05-27-2011
My Device: Blackberry tablet

Re: Best way to handling Text in BB10 apps

Cheers for the tip. It should do this already as I did set up a project initially like this. However .ts does not get populated with content on build. Any ideas?

 

I've tried force it with lupdate command. I looks generates all the locals, but something automaticlly get rid of after a 2 of sec. I dont even have the time to save it. hmmmm very strange. Any idea?