cancel
Showing results for 
Search instead for 
Did you mean: 

Change Locale

Former Member
0 Kudos

Hi all,

is it possible to change the locale of an WebDynPro applicatin after it was loaded?

What I want is something like a dropdown-box with available locales, the user can then select one and the webdynpro gets reloaded. After that reload the whole application should be in the new language.

I translated the needed .xlf-files and everything works more or less fine via the browser-based language setting (Accept-Language header) at least after i close all browser windows. Same goes for the "sap-locale" URL-parameter, I need to close all browser windows.

There seems to be no possibility to change the language "on-the-fly" after a webdynpro application is loaded, am I right? I only found one single setLanguage()-function in IWDJCOClientConnection but I dont know how this could help me...

Thanks and regards,

Peter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Peter,

You are right -- it is impossible to change locale after application has been started. The only way is to restart application with same URL + additional parameter sap-locale=<loc_LOC>

Some time ago (more then a year) I wrote about this, and my sample application works almost as you described (i.e. drop-down with locales, several translated texts, etc)

However, I never get a problem with browser windows. If you change locale via sap-locale parameter one and only one browser is affected.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hello Valery,

thanks for your answer.

The problem I have is that if I start the application with i.e. http://myserver.com:50100/webdynpro/dispatcher/local/MyApplication/MyApplication?sap-locale=en (works as intended, the app is in english) and after that change the sap-locale parameter to "de" without closing all browser windows the application won't change the language and remains english.. I think there is kind of a chaching mechanism that prevents this from working.

So you say you managed to makes things work almost as I intended. Could you please provide me with some sample code?

Thanks and regards,

Peter Osthoff

Former Member
0 Kudos

Peter,

Here is my solution in details (sorry, plain text only):

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Thanks a lot Valery, it works perfect now!

My problem was this line:

WDClientUser.forceLogoffClientUser(url);

I knew i have to kill the session somehow, but I din´t guess that it is so easy

Thank you again for your help!

Regards,

Peter Osthoff

Answers (0)