BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   [Localization] How to switch from a resource to another?? (http://www.blackberryforums.com/developer-forum/180569-localization-how-switch-resource-another.html)

siagianfaber 03-11-2009 05:22 AM

[Localization] How to switch from a resource to another??
 
Dear all,

I'm trying to understand how to use Localization API right now.
I have created a resource file, let's say MyResource.rrh (you know that MyResource.rrc automatically generated). The screens and everything that need the resource able to recognize it. Ok, everything goes fine.

And then i created another resource, MyResource_it.rrc. My question is, how can i switch from MyResource.rrc to MyResource_it.rrc ?

p.s Anyone please correct me if there's anything wrong i've written above.

simon.hain 03-11-2009 09:41 AM

you have to switch the device language to italian

siagianfaber 03-11-2009 09:07 PM

Is there another way other than switching the device language?
I use ResourceBundle to load the resource file which is MyResource.rrc.

Code:

private ResourceBundle resourceBundle = ResourceBundle.getBundle(MessageResource.BUNDLE_ID, MessageResource.BUNDLE_NAME);
By using the same class, how can i switch the MyResource.rrc to MyResource_it.rrc ?

Ivanov 03-12-2009 09:56 AM

use Locale.setDefault(). I guess you have to reload your resourceBundle after it.

Code:

Locale.setDefault(Locale.LOCALE_de);


All times are GMT -5. The time now is 02:00 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.