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

Java Development

Reply
Developer
amrishodiq
Posts: 112
Registered: ‎09-23-2009
My Device: Not Specified

Is this possible to Localize app with a language which is not in the constant?

[ Edited ]

Hi all,

I tried to implement Localization to my app. The requirement said to localize my app into English and Indonesian. But the problem is Indonesia is not listed in the constants. I have read another thread about this, but it's not solved.

 

The documentation siad that this class (Locale) is compatible with java.util.Locale. In which way the compatibility is? I tried to create my own Locale (using java.util.Locale) which I should be able to create one using String language and String country parameter. The problem is java.util.Locale is simply not there. I cannot find it in Blackberry library.

 

Any idea of how to localize an app into language that is not listed in Locale constants?

Thanks in advance.

Please use plain text.
BlackBerry Development Advisor
MSohm
Posts: 14,690
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook

Re: Is this possible to Localize app with a language which is not in the constant?

You can use _in for Indonesian BlackBerry resource files.  You can see this in action in the localizationdemo included with the BlackBerry Java Plug-in for Eclipse and BlackBerry JDE.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
amrishodiq
Posts: 112
Registered: ‎09-23-2009
My Device: Not Specified

Re: Is this possible to Localize app with a language which is not in the constant?

Hi Mark,

Thanks for the answer. Yes, I have read the localization demo. Unfortunately, we have implemented our code based on the RIM's tutorial about how to use Localization. When we change the language setting, we do it with this kind of code:

 

 

Locale.setDefault(Locale.get(Locale.LOCALE_en, null));

 

 

So are, most of our UI components uses custom fields that make it difficult to change the mechanism just like the localization demo's code.

 

So, for now, my solution is to use another reserved language constants, since we haven't support these language, such as Cathalan.

 

 

Please use plain text.
Regular Contributor
ricken
Posts: 83
Registered: ‎12-09-2010
My Device: Not Specified

Re: Is this possible to Localize app with a language which is not in the constant?

Hello,

I've the same problem, and I want to create a custom language like "uk_APPMODE1"

I've tried the folowing code :

 

Locale loc = Locale.get("uk_APPMODE1");
ResourceBundleFamily  family = ResourceBundleFamily.getBundle(BUNDLE_NAME).getFamily();
		  
ResourceBundle bundle = family.getBundle(loc);
		 
String res = bundle.getString(MyAppResource.TEST);

 

I've a MyApp.rrc, MyApp_uk.rrc, MyApp_uk_APPMODE1.rrc but it returns me the value present in MyApp_uk.rrc the default language file.

 

I can't get it work and I don't want to use an existing language, but create my own custom language because it depends of the type of the running application and not of the bby language.

 

Thanks for your help

Please use plain text.