BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-11-2009, 05:22 AM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Model: 8310
PIN: N/A
Carrier: Telkomsel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default [Localization] How to switch from a resource to another??

Please Login to Remove!

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.
Offline  
Old 03-11-2009, 09:41 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you have to switch the device language to italian
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 03-11-2009, 09:07 PM   #3 (permalink)
New Member
 
Join Date: Mar 2009
Model: 8310
PIN: N/A
Carrier: Telkomsel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 ?
Offline  
Old 03-12-2009, 09:56 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Code:
Locale.setDefault(Locale.LOCALE_de);
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.