on 08-06-2008 2:48 PM
Dear All,
In my present application,I need to pass the language as a parameter to the backend.As my application needs to support different languages.In this regard I need to capture the current user language and if the user language is not mentioned then it should take the Browser language and even if that is not present it should take the server language.
I am Using XLF Files in Webdynpro for the language change in Appilcation Screen and it is working properly.
The present code which I am using to get the language is:
CODE:
IWDClientUser user = WDClientUser.getLoggedInClientUser();
IUser iuser = user.getSAPUser();
String userid = iuser.getDisplayName();
wdComponentAPI.getMessageManager().reportSuccess("userid"+userid);
iuser.getLocale();
But when i am trying to print it.I am getting an Null value.Can anybody please let me know if i am going the right way and help me in getting the language of the user.
Thanks in Advance
Thanks and Regards,
Nishita Salver
Hello,
you can try this, in my portalenviroment this solution works:
WDClientUser.getCurrentUser().getLocale();
So from locale you can also convert into a string representation or whatever you want to.
kind regards
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this code
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
wdComponentAPI.getMessageManager().reportSuccess( user.getUniqueName() + " " + user.getLocale().getDisplayLanguage());
} catch (WDUMException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.