cancel
Showing results for 
Search instead for 
Did you mean: 

Change Browser Language with Javascript

Former Member
0 Kudos

Hey

I need to change the language of the user in the portal , using two small links , EN | PT if the user clicks EN the browser language will be EN_US else pt_PT how can i do something like this?

i'm looking for javascript solution mainly or anything else related to sap. thanks

Accepted Solutions (1)

Accepted Solutions (1)

pramod_gopisetty1
Active Contributor
0 Kudos

Hi,

String user = null;

try {

user =

WDClientUser

.getCurrentUser()

.getSAPUser()

.getUniqueName();

} catch (WDUMException e) {

// fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), e);

}

try{

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("user"+user);

IUserFactory userfact = UMFactory.getUserFactory();

IUserMaint userMaint = userfact.getMutableUser(user);

userMaint.setLocale(Locale.FRENCH);

userMaint.commit();

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("success");

}catch(Exception e){

}

Hope this code helps you.

Cheers-

Pramod

Former Member
0 Kudos

thanks for the posts , both were useful but none seem to be the perfect solution for us

our SAP JSF is Read Only and cant change the user language or profile.

We are looking for something more specific like changing the user "Session" language or something similar?

any tips ?

thanks

Answers (2)

Answers (2)

Former Member
0 Kudos

Im still looking for a answer to this problem if anyone have done something similar before.

ive been looking at ume.logon.locale but it seems the user languague and browser preferences overwrite this.

im also looking at HTTP Accept-Languague and how to change this but no solution found yet.

Thanks

former_member182598
Active Contributor
0 Kudos

HI,

You might like to refer to

Thanks

Prashant