cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the user default language programically ?

Former Member
0 Kudos

Hi all,

I have a specific requirement to develope using Webdynpro. I want to programically change the default language of a selected user. Could some one help me . I promise to award points for the solution.

Thank you in advance

Regards

Maruti

Accepted Solutions (0)

Answers (3)

Answers (3)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Maruti,

the Web Dynpro session locale cannot be dynamically changed at runtime without restarting the application which implies a session restart and even a re-login.

See:

Regards, Bertram

sridhar_k2
Active Contributor
0 Kudos

Hi Maruthi,

This code may be helpful for you.

//UID is Unique ID of the user

String UID = "USER.PRIVATE_DATASOURCE.un:ttmdp1";

IUserMaint us = UMFactory.getUserFactory().getMutableUser(UID);

//Setting the Language

us.setLocale(Locale.ENGLISH);

us.save();

us.commit();

//Checking

IUserMaint us1 = UMFactory.getUserFactory().getMutableUser(UID);

response.write("Lang "+us1.getLocale());

Regards,

Sridhar

Former Member
0 Kudos

Hi Sridhar,

Thank you for your mail. I have tried your code but its is not working for me. I wanted to set the language to Italin and it don't giv eme the result. Could you please clarigy me ?

us.setLocale(Locale.ITALIAN);

In UME I have created user text4 with default language English and want to change to Italian trough WebDynpro program.

My Code is:

-


String Uid = "USER.PRIVATE_DATASOURCE.un:test4";

IUserMaint us = UMFactory.getUserFactory().getMutableUser(Uid);

us.setLocale(Locale.ITALIAN);

us.save();

us.commit();

// Checking

IUserMaint us1 = UMFactory.getUserFactor().getMutableUser(Uid);

msgMgr.reportSuccess("new Lang "+us1.getLocale());

Could you please clarify me where I am going wrong?

Thank you in adavance

Regards

Maruti

sridhar_k2
Active Contributor
0 Kudos

Hi Maruti,

I could able to set user language it to Italian(it) or German(de).

us.setLocale(Locale.ITALIAN);

// Checking

IUserMaint us1 = UMFactory.getUserFactor().getMutableUser(Uid);

msgMgr.reportSuccess("new Lang "+us1.getLocale());

//it gave me - it

Regards,

Sridhar

Former Member
0 Kudos

Hi Sridhar,

Thank you for your reply. I think the user I am using to Deploy WD programs does not have rights/permissions to update language settings through WD program .Thats what I am thinking. Do you have any idea whats are the permissions required for SDM user to automatically change the settings?

Any way Thank you for your reply.

Regards

Maruti

Former Member
0 Kudos

Hi Sridhar,

I tried your code and it seams to be working for few langages like CANADA, CHINA< GERMAN, KOREAN and many more . But I couln't get any clue how to set for languages like Arabic, Bulgarian,Hungarian, Czech and few more

Could you please suggest me any tips.

Cheers

Maruti

sridhar_k2
Active Contributor
0 Kudos

Hi Maruti,

I guess, Locale supports for few Languages.

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html

Regards,

Sridhar

Former Member
0 Kudos

Hi

Go through link

it might helps.

Thanks

Lohi.