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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Contributor
paiki
Posts: 29
Registered: ‎01-18-2011

Is there a way to 'Reset' App?

Hi fellows,

I'm trying to find a way to "reset" my App.

 

Why?
I made an option for the user change the Language. I would like to change the Language, close and open the App again.

 

I'm currently thinking for the possibility for closing all pages except main, and reload the main page with the nem Language. Any idea here?

Please use plain text.
Developer
Zmey
Posts: 921
Registered: ‎12-18-2012

Re: Is there a way to 'Reset' App?

[ Edited ]

A simple way to update QML strings is to use Retranslate class:

http://developer.blackberry.com/cascades/reference/bb__cascades__qmlretranslate.html

 

In other cases LocaleHandler can be used:

http://developer.blackberry.com/cascades/reference/bb__cascades__localehandler.html

 

Ideally the screens should be language-aware. If you want to reload everything on language change then destroying the root scene and reloading it from QML should probably work, but current UI state will be lost.

 

I'm not sure if creating a translation mechanism inside of an app which is alternative to the system one is a good idea. If it's a requirement then the behavior of the two above classes can be mimicked I think. Reloading the entire scene is also an option.

 

Please use plain text.
Developer
Curahee
Posts: 122
Registered: ‎01-12-2013
My Carrier: -

Re: Is there a way to 'Reset' App?

Why do you wrote your own language implementation? Why do you not use the internationalization features of the phone itself? The user will choose the language he wants on the phone. I don't think he would set his system language to english, and the language of your app to french... That's ridicolous in my opinion.

 

Have a look over here

http://developer.blackberry.com/cascades/documentation/device_platform/internationalization/

______________________________________________________
Voetbal afgelast in België? Check at AppWorld
Please use plain text.
Contributor
paiki
Posts: 29
Registered: ‎01-18-2011

Re: Is there a way to 'Reset' App?

The app itself have a lot of parameters that set different search systems, images, pages when starts. Everything is different depends on each language.

 

it's like "ebay.com" and  "ebay.it" inside the same app. But if you choose .com, you'll have service/images/banners and pages exclusive for .com, and if you choose .it you'll also have different stuff.

I'll try destroying all and reloading. Thanks

Please use plain text.