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

Web and WebWorks Development

Reply
Contributor
chaivck
Posts: 24
Registered: ‎01-19-2011
My Device: Torch

Re: Internationalization for WebWorks App

Hi Erik Oros,

 

Thank you very much for the links. The solution is working perfect.

 

But we have one problem.

 

If user changes the device locale from device options and if he/she didn't restart the phone, the application title is not changed.

 

Is there anyway we can overcome this problem?

 

Thanks,

Chaivck.

 

 

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: Internationalization for WebWorks App

That might be a little more difficult; I'm not aware of any such listener that could be implemented.

 

One step closer would be implementing the onForeground event to update the title when the application is activated:

https://developer.blackberry.com/html5/apis/blackberry.app.event.html#.onForeground

 

That still doesn't give you an immediate update, but it does prevent the need for a restart (i.e. it updates each time the app is launched.)

 

Unless you're setting some internal timer to check the locale every ~5s or so and never actually quitting your application, then I don't think you'll be able to get an immediate change. The timer could potentially run only when the app is in the background to minimize performance impact in your app. I'm not sure of the overall impact this would have on the OS performance though if the call is being made regularly.

 

Perhaps someone in the community has a better idea though...


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: Internationalization for WebWorks App

[ Edited ]

Actually, just found these:

 

http://supportforums.blackberry.com/t5/Java-Development/System-Global-Events/ta-p/444824

 

http://supportforums.blackberry.com/t5/Java-Development/Global-Events-and-Global-Event-Listeners/ta-...

 

On the Java side, there are some global events that would be triggered on a change. There is already a community extension for global events:

 

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/Smartphone/GlobalEvent

 

So it seems the implementation should be fairly "simple".


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Contributor
chaivck
Posts: 24
Registered: ‎01-19-2011
My Device: Torch

Re: Internationalization for WebWorks App

Hi Erik Oros,

 

Thank you for the help. The solution is working great.

 

 

Thanks,

Chaivck.

Please use plain text.