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
Highlighted
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: Localization of menu items

Thanks.

 

The trick worked Smiley Wink

 

 

// ... aMenuItem = some menu item

boolean localeChanged = false;

Locale oldLocale = Locale.getDefaultForSystem();

if (oldLocale.getLanguage().equalsIgnoreCase("en") == false)

{

localeChanged = true;

Locale.setDefault(Locale.get("en"));

}

 

if (aMenuItem .toString().equalsIgnoreCase(aMatchString))

{

rMenuItem = aMenuItem;

if (localeChanged == true)

{

// return the original locale

Locale.setDefault(oldLocale);

}

 

return rMenuItem;

 

 

 



"Listen carefully, I shall say this only once"