Skip to Content
author's profile photo Former Member
Former Member

Error while trying to retrevie the Current Portal Language

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2008 at 06:00 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 06:43 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.