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
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold
My Carrier: Vodafone India

Re: MultiLingual Language Implementation

okay, I have done what you have suggested earlier. But the only problem is the text which is already displayed is not getting changed and if I clicked on a button then the text on the dialog is displayed in Spanish language(I selected as Locale).

My question to you is can we change the application language(whole) without changing the device language.

please correct me if I am doing any thing wrong.

For your information can we implement the same functionality as it is there on this website (language change)

Thank you.
warm regards
Mohammed Aziz
Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: MultiLingual Language Implementation

This is pretty much where I thought you were anyway. 

 

Your issue appears to be that the current screen is not updated.  This makes sense.  As I suggested, you should try restarting the Application and see if it works when you do that.  If it does (and I'm confident it will), then the obvious thing to do is to recreate all screens when the user changes language.  You are going to have to recreate them.  There is unfortanutely no way you can tell the BlackBerry to do this for you. 

Please use plain text.
Developer
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold
My Carrier: Vodafone India

Re: MultiLingual Language Implementation

Yes, The same thing is happening in my app. When I select the language to be changed then except the current screen the other two screens in which I used the localized files are getting displayed in the selected language.

As you said restarting the application(Can you please elaborate this?). I suspect you are asking me to click the back key to close the app and then restart it OR you want me to pop up and then to push the same screen?

I think I am very close to accomplish this task.

Thank you.
warm regards
Mohammed Aziz
Please use plain text.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: MultiLingual Language Implementation

Hi Mohammed,

 

The problem is your current  screen not updating.

Then why dont you follow a mechanism like pop the current screen and push it again , mean while show some loader screen.

 

Thanks.

Please use plain text.
Developer
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold
My Carrier: Vodafone India

Re: MultiLingual Language Implementation

Okay, I will implement as you suggested and will get back to let you know.

Thank you
warm regards
Mohammed Aziz
Please use plain text.
Developer
MohammedAziz
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold
My Carrier: Vodafone India

Re: MultiLingual Language Implementation

Thank you PETER and PRADEEP
Eventually I implemented what I required to accomplish.
below is the code I used to refresh the screen.

Runnable runnable = new Runnable() {

public void run() {
// TODO Auto-generated method stub
Locale.setDefault(Locale.get(Locale.LOCALE_es));
delete(verticalFieldManager);
verticalFieldManager = displayInfo();
add(verticalFieldManager);
verticalFieldManager.invalidate();
}
};

UiApplication.getUiApplication().invokeLater(runnable);

Thank you once again.

warm regards
Mohammed Aziz
Please use plain text.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: MultiLingual Language Implementation

Well, good to know.

 

Also close this thread.

 

Thanks.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: MultiLingual Language Implementation

Note that this is redundant, I would remove it to save confusion:

 

verticalFieldManager.invalidate();

 

 

Please use plain text.