Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Change Browser Language with Javascript

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

Former Member
Former Member replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question