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
Posts: 32
Registered: ‎01-18-2011
My Device: Curve 8900

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?

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

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.

 


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

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/

______________________________________________________
BB10-OAuth: GitHub
Contributor
Posts: 32
Registered: ‎01-18-2011
My Device: Curve 8900

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