cancel
Showing results for 
Search instead for 
Did you mean: 

How to change an application's locale

Former Member
0 Kudos

Hello All,

I'm running an application outside a portal

and need to add a button for changing the language.

can anyone tell me how to do it with webDynpro?

Thanks for your time, Adi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Adi,

The reply I have given for the following query may help you with regard to this:

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Nibu,

Nice solution.

I did exactly what you wrote but it is not working.

even changed the variable 'local' to "en" (hard coded)and it is not changing to english.

any suggestions?

Former Member
0 Kudos

Hi,

Assuming you use IE, check the browser setting:

Internet Options,

on General tab: Languages.

Clear whatever is filled in there.

Good luck,

Roelof

Former Member
0 Kudos

Adi,

First, variable is "sap-locale" -- check the name.

Second, the complete guidelines are here:

What is left uncommented is that WD application must be configured with property Authentication=true (open Application editor in NW IDE and set it on "Properties" tab)

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi Nibu and Valery,

I seem to have a conflict here:

Nibu wrote:

"The only way to achieve this functionality is to forcefully log-off the user & relogin with the selected locale. <b>But if used for an authenticated application, the user needs to enter his credentials again</b>. In case of anonymous users, this works perfectly"

Valery wrote:

"...WD application must be configured with property Authentication=true"

Now I have a problem:

it only works when setting "Authentication=true",

but as Nibu said: it asks for users credentials each time I change the language - since this app is meant for anonymous users they are not suppose to see a logon screen.

any suggestions?

Former Member
0 Kudos

Hi Adi,

The priority of language selection in a wd application is like:

1) Language of the logged in user

2) Language of the browser

3) Language of the application Locale

4) Language of the system

5) Language of the JVM

So, if the application is authenticated, the language associated with the user is given the first priority. If it is not authenticated, it will then check for the language of the browser. If that is also blank, then only the application's locale would be considered. So for language selection to work for an unauthenticated application, any language preferences for the browser should be cleared. Only then the application would load with the specified language.

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Hello again nibu,

Thanks a lot for your time!

as for your last reply:

The language preferences for the browser is clear.

my problem is that it is working only when the WD application is configured with property "Authentication"= true.

because of it - it asks for users credentials each time I change the language.

do you have an explanation for needing to change the property to true?

is it working for you without setting that property?

are you running your application through a portal using the anonymous user?

thanks again, Adi

Former Member
0 Kudos

Adi,

It seems to be either a bug or "feature" of WD.

WD has a notion of scopes (request, application, session etc) with associated scope's variables, and there are several scopes that reflects "session" -- there is session associated with authenticated user, and separate session per client application (several of them may have single per-user session).

So my guess is that for some reason WD associates locale with per-user session object, rather then with per-application session. Hence you may observe behavior you mentioned -- client application locale survives application exit, but is refreshed after user exit.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi Adi,

Yes, for me it is working fine without authentication. But I haven't integrated it with the portal, though, I feel that shouldn't cause a problem.

Best Regards,

Nibu.

Answers (1)

Answers (1)

Yashpal
Active Contributor
0 Kudos

Hi,

u can change the locale of application by setting the application properties u can find document at the above link

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/39dcb1e5-0601-0010-51b2-c52...

Former Member
0 Kudos

Hi Yashpal,

Tanks for the fast reply.

if I understand correctly this PDF shows how to define

constant application properties, it doesn't show how to

change them dynamically at run time.

does anyone know of a way?

thanks again, Adi